【发布时间】:2011-06-11 03:32:22
【问题描述】:
如何禁用 onclick 事件?
我试过onclick="this.disabled=true;",但是不行。
这是一个 HTML 表格:
<table>
<tr>
<td onclick="parent.location='home.php'">Available</td>
<td onclick="parent.location='home.php'">Available</td>
</tr>
<tr>
<td onclick="parent.location='home.php'"><div onclick="this.disabled=true;">Booked</div></td>
<td onclick="parent.location='home.php'">Available</td>
</tr>
</table>
使用上面的代码,它仍然是 home.php,即使我点击标记为“已预订”的表格单元格。
【问题讨论】:
标签: javascript events html-table onclick