Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

loop through all dom elements javascript

const elements = document.querySelectorAll(
  '.my-class, .your-class'
);

elements.forEach(element => {
  console.log(element);
});
Source by bobbyhadz.com #
 
PREVIOUS NEXT
Tagged: #loop #dom #elements #javascript
ADD COMMENT
Topic
Name
2+2 =