JAVASCRIPT resource

element.style

element.style



			
The HTML element.style property is used
to GET as well as SET the inline 
style of an element. While getting, 
it returns a CSSStyleDeclaration object that 
contains a list of all styles properties 
for that element with values assigned for 
the attributes that are defined in the 
element's inline style attribute.  


element.style.backgroundColor = "red";//set 
the background color of an element to red
				
		

  • Example 1
  • Example 2