javascript create element with html code code example
Example 1: dom create element
var btn = document.createElement("BUTTON"); // Create a <button> element
btn.innerHTML = "CLICK ME"; // Insert text
document.body.appendChild(btn); // Append <button> to <body>
Example 2: js create tag
//create div
let div = document.createElement('div');
//create button
let button = document.createElement('button');