js get child element by id code example
Example 1: how to get child element in javascript
let content = document.getElementById('menu');
let firstChild = content.firstChild.nodeName;
console.log(firstChild);Code language: JavaScript (javascript)
Example 2: how to get child element in javascript
let firstChild = parentElement.firstChild;
Code language: JavaScript (javascript)