Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.onload = function () {
- var div = document.getElementById('first-div');
- var buttons = document.getElementsByClassName('move-button');
- console.log(buttons[0]) # выводит
- for (var i = 0; i < buttons.length; i++) {
- buttons[i].onclick = function () {
- console.log(buttons[i]); # не выводит
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement