
when you click a button how will you change the background color of a web page?

<html>
<script language="javascript">
function change(id)
{
switch (id)
{
case 'c1':
document.body.bgColor = "red";
break;
case 'c2':
document.body.bgColor = "green";
break;
case 'c3':
document.body.bgColor = "yellow";
break;
case 'c4':
document.body.bgColor = "blue";
break;
case 'c5':
document.body.bgColor = "pink";
break;
}
}
</script>
<body>
<input type="button" id="c1" onclick="change(this.id)" value="Red"/>
<input type="button" id="c2" onclick="change(this.id)" value="Green"/>
<input type="button" id="c3" onclick="change(this.id)" value="Yellow"/>
<input type="button" id="c4" onclick="change(this.id)" value="Blue"/>
<input type="button" id="c5" onclick="change(this.id)" value="Pink"/>
</body>
</html>