how to create an element using javascript in html code example
Example 1: js create element
var newDiv = document.createElement("div");
document.body.appendChild(newDiv);
Example 2: js create tag
//create div
let div = document.createElement('div');
//create button
let button = document.createElement('button');