Mega Code Archive

 
Categories / JavaScript Tutorial / Style
 

Change element color by setting the color style

< html> <head> <title>A Simple Page</title> <script language="JavaScript"> <!-- function colorchange() {     head1.style.color = "red"; } function colorchangeback() {     head1.style.color = "black"; } //  --> </script> </head> <body> <h1 id="head1" onMouseover="colorchange()" onMouseout="colorchangeback()"> Welcome to this page!</h1> <P>A lot of interesting text goes here!</p> </body> </html>