Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

add style javascript

// Bad:
element.setAttribute("style", "background-color: red;");
// Good:
element.style.backgroundColor = "red";
 
PREVIOUS NEXT
Tagged: #add #style #javascript
ADD COMMENT
Topic
Name
9+2 =