Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

for...of...loop and NodeLists

const elements = document.querySelectorAll('.foo');

for (const element of elements) {
    element.addEventListener('click', doSomething);
}
Source by bitsofco.de #
 
PREVIOUS NEXT
Tagged: #NodeLists
ADD COMMENT
Topic
Name
6+3 =