Roh*_*han 5 html javascript css html-table cell
我正在尝试在用户单击单元格时更改HTML表格单元格的背景颜色.关于如何做到这一点的任何想法?我可以访问JS Prototype库,因此欢迎任何有关Prototype或直接Javascript的建议.
丑陋,但演示了效果:
<table>
<tr>
<td onclick="this.style.backgroundColor = 'Red';">Sample</td>
<td onclick="this.style.backgroundColor = 'Blue';">Data</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
26305 次 |
| 最近记录: |