javascript create dom element with attributes code example
Example: javascript create element with attributes
var element = document.createElement("span");
element.setAttribute("style", "color: red");
document.body.appendChild(element);
var element = document.createElement("span");
element.setAttribute("style", "color: red");
document.body.appendChild(element);