Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Add event listener for loop

allButtonsOnPage.forEach(function(button, index) {
  button.addEventListener('click', function() {
    logButtonIndex(index);
  });
});
Source by www.nickang.com #
 
PREVIOUS NEXT
Tagged: #Add #event #listener #loop
ADD COMMENT
Topic
Name
7+8 =