Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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])
}
 
PREVIOUS NEXT
Tagged: #select #children #javascript
ADD COMMENT
Topic
Name
4+2 =