Mega Code Archive

 
Categories / JavaScript DHTML / Style Layout
 

Change element color

<html> <head> <title>CSS</title> </head> <body> <h1 id="h1element">The Title</h1> <p id="firstelement">The first element.</p> <p id="secondelement">The second element.</p> <script type = "text/javascript" > var element1 = document.getElementById("firstelement"); element1.style.color = "#0000FF"; </script> </body> </html>