Code:
<!DOCTYPE html>
<html>
<body>
<center>
<script>
function myArray(n)
{
var backcolor=["#00f00","#ff0000","#0000ff","#cce"];
document.bgColor=backcolor[n];
}
</script>
<a href="#" onmouseover="myArray(1)">Red</a>
<a href="#" onmouseover="myArray(2)">Blue</a>
<a href="#" onmouseover="myArray(4)">Green</a>
<a href="#" onmouseover="myArray(3)">Ash</a>
<h1>Changing background color</h1>
</center>
</body>
</html>
No comments:
Post a Comment