Answers for "selector all child elements"

1

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
5

how to target all child elements css

.wrapper * {
    color: blue;
    margin: 0 100px; /* Only for demo */
}
.myTestClass > * {
    color:red;
    margin: 0 20px;
}
Posted by: Guest on February-25-2021
2

all child selector css

.div > * {
    /* All the Child will get this style individually */
}
Posted by: Guest on March-03-2022

Code answers related to "selector all child elements"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language