createelement a with attribute javascript 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);