js vanilla function to create a dom element code example
Example 1: create element javascript with id
var btn = document.createElement('div');
btn.setAttribute("id", "div1");
Example 2: javascript es6 dom manipulation
const myChildElemet = myElement.querySelector('input[type="submit"]')
// Instead of
// document.querySelector('#foo > div.bar input[type="submit"]')