Answers for "select all child elements javascript"

0

select all children javascript

/* SELECT using PARENT.childNodes */
let allChildren = document.querySelector("#parentSelector").childNodes

/* PRINT */
for(let i=0; i < allChildren.length; i++) {
         console.log("Child #", i + 1, allChildren[i])
}
Posted by: Guest on July-17-2021
0

select all child elements javascript

var nodes = document.getElementById('ID_of_parent').childNodes;
Posted by: Guest on April-01-2021

Code answers related to "select all child elements javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language