javascript get child element by tag code example
Example 1: javascript get child by name
let myForm = document.getElementById('form');
let child = myForm.querySelector('input[name="username"]');
console.log(child);
Example 2: get child of child javascript
var li = document.querySelector("li");
var number = 13;
li.children[0].children[0].innerHTML = number;
Example 3: how to get child element in javascript
let firstChild = parentElement.firstChild;
Code language: JavaScript (javascript)