<!--变色-->
<HTML>
<HEAD>
<script type="text/javascript">
function bgcolor1(obj)
{
switch(obj.id)
{
case '1':
document.getElementById("b1").bgColor="green";
break;
case '2':
document.getElementById("b1").bgColor="blue";
break;
case '3':
document.getElementById("b1").bgColor="red";
break;
default:
alert("不在范围内");
}
}
</script>
</HEAD>
<BODY id="b1" name="b1" bgColor="pink">
<form action="#">
<table align="center">
<tr>
<td><input type="button" value="不许碰我" οnclick="bgcolor1(this);" id="1" name="btu"></input></td>
<td><input type="button" value="警告你别碰我" οnclick="bgcolor1(this);" id="2" ></input></td>
<td><input type="button" value="给你点颜色看看" οnclick="bgcolor1(this);" id="3" ></input></td>
<tr>
</table>
</form>
</BODY>
</HTML>
<HTML>
<HEAD>
<script type="text/javascript">
function bgcolor1(obj)
{
switch(obj.id)
{
case '1':
document.getElementById("b1").bgColor="green";
break;
case '2':
document.getElementById("b1").bgColor="blue";
break;
case '3':
document.getElementById("b1").bgColor="red";
break;
default:
alert("不在范围内");
}
}
</script>
</HEAD>
<BODY id="b1" name="b1" bgColor="pink">
<form action="#">
<table align="center">
<tr>
<td><input type="button" value="不许碰我" οnclick="bgcolor1(this);" id="1" name="btu"></input></td>
<td><input type="button" value="警告你别碰我" οnclick="bgcolor1(this);" id="2" ></input></td>
<td><input type="button" value="给你点颜色看看" οnclick="bgcolor1(this);" id="3" ></input></td>
<tr>
</table>
</form>
</BODY>
</HTML>