Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript create element with attributes

var element = document.createElement("span");
element.setAttribute("style", "color: red");
document.body.appendChild(element);
 
PREVIOUS NEXT
Tagged: #javascript #create #element #attributes
ADD COMMENT
Topic
Name
7+2 =