Answers for "how to select child class property in js"

1

javascript get child element by class

// get child element of #test with class my-class
var testContainer = document.querySelector('#test');
var childNodeByClass = testContainer.querySelector('.my-class');
Posted by: Guest on March-08-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 "how to select child class property in js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language