How to change the Element Styles using javascritp ?

 
 
     This is the syntax of the code 
 
    document.getElementById('thediv').style.[ATTRIBUTE] = '[VALUE]'
f   for Ex:

      document.getElementById("xyz").style["paddingTop"] = '10px' ;
this code will changes the padding to 10px. 
 
 
 
 
 
 
 

Comments