css應用:單擊table使點擊的行變色

來源:互聯網
上載者:User

代碼如下:

<script>
function bgChange(obj)
{
objobj.bgColor=obj.bgColor==""?"#B6DC73":"";
}
</script>
<table width="80%" border="1" bgcolor="#ffffcc">
<tr onclick="bgChange(this)">
<td>aa25.cn</td>
<td>aa25.cn</td>
</tr>
<tr onclick="bgChange(this)">
<td>aa25.cn</td>
<td>aa25.cn</td>
</tr>
<tr onclick="bgChange(this)">
<td>aa25.cn</td>
<td>aa25.cn</td>
</tr>
</table>

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.