Crear elemento JavaScript con ID
var btn = document.createElement('div');
btn.setAttribute("id", "div1");
Mr. Samy
var btn = document.createElement('div');
btn.setAttribute("id", "div1");
var script = document.createElement("script");
script.src = "https://url.com/";
document.head.appendChild(script);
//create div
let div = document.createElement('div');
//create button
let button = document.createElement('button');