Change text color : Color « Style Layout « JavaScript DHTML






Change text color

  

<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()">
Mouse mouse in!</h1>
</body>
</html>

   
    
  








Related examples in the same category

1.Body text Color
2.Foreground Color Example
3.'color' Example
4.Change element color
5.div.style.color="#fff";
6.Assign random color to