Change element color : Color « Style Layout « JavaScript DHTML






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>

   
  








Related examples in the same category

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