Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

.children javascript

const myElement = document.getElementById('foo');
for (let i = 0; i < myElement.children.length; i++) {
  console.log(myElement.children[i].tagName);
} // Logs the name of all the children.
 
PREVIOUS NEXT
Tagged: #javascript
ADD COMMENT
Topic
Name
2+7 =