Answers for "js first child of a div selector"

6

first child element javascript

Both these will give you the first child node:

console.log(parentElement.firstChild); // or
console.log(parentElement.childNodes[0]);

If you need the first child that is an element node then use:

console.log(parentElement.children[0]);
Posted by: Guest on September-05-2020
1

css selector first level child

.MyClass>tbody>tr>td { border: solid 1px red; }
Posted by: Guest on June-08-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language