Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

CSS on Javascript

div.style.color = 'blue';                                      
// adds the indicated style rule

div.style.cssText = 'color: blue; background: white';          
// adds several style rules

div.setAttribute('style', 'color: blue; background: white');    
// adds several style rules
Source by www.theodinproject.com #
 
PREVIOUS NEXT
Tagged: #CSS #Javascript
ADD COMMENT
Topic
Name
4+2 =