Answers for "select all children 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

Code answers related to "select all children javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language