Answers for "select child javascript"

0

how to get child element in javascript

let content = document.getElementById('menu');
let firstChild = content.firstChild.nodeName;
console.log(firstChild);Code language: JavaScript (javascript)
Posted by: Guest on May-22-2021
0

select child javascript

Syntax
element.children

Example
Change the background color of the second child element of a <div> element:

var c = document.getElementById("myDIV").children;
c[1].style.backgroundColor = "yellow";
Posted by: Guest on March-02-2021

Code answers related to "select child javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language