<Script> function changeColor() { var o = event.srcElement; if(o.checked) o.parentElement.parentElement.style.backgroundColor="red"; else o.parentElement.parentElement.style.backgroundColor="white"; } </script> <table> <tr> <td> <input type="checkbox" onclick="changeColor()"> this row this row this row </td> </tr> </table>
function changeColor()
{
var o = event.srcElement;
if(o.checked)
o.parentElement.parentElement.style.backgroundColor="red";
else
o.parentElement.parentElement.style.backgroundColor="white";
}
</script>
<table>
<tr>
<td>
<input type="checkbox" onclick="changeColor()">
this row this row this row
</td>
</tr>
</table>
//连我这不是搞网页开发的都知道~~<Script>
function changeColor()
{
var o = event.srcElement;
if(o.parentElement.parentElement.style.backgroundColor == "red")
o.parentElement.parentElement.style.backgroundColor="white";
else
o.parentElement.parentElement.style.backgroundColor="red";
}
</script>
<table>
<tr>
<td>
<input type="checkbox" onclick="changeColor()" checked=true>
this row this row this row
</td>
</tr>
</table>