Create a dynamic webpage in HTML to change the background color of the page?

Tripati_tutu
Posted by Tripati_tutu under JavaScript category on | Points: 40 | Views : 3480
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type ="text/javascript" language="javascript">
function f1()
{
document.bgColor="red"
}
function f2()
{
document.bgColor="blue"
}
function f3()
{
document.bgColor="green"
}
</script>
</head>
<body>
<form action ="">
<input type="button" name="b1" value="red" onclick="f1()" />
<input type="button" name="b2" value="blue" onclick="f2()" />
<input type="button" name="b3" value="green" onclick="f3()" />
</form>
</body>
</html>

Comments or Responses

Login to post response