你可以将input标签的onclick设置为不冒泡方式,就可以实现只有input标签响应onclick,举例如下:
<table border=1 width=100>
<tr οnclick="alert('td')">
<td><input type="checkbox" οnclick="window.event.cancelBubble=true;alert('input')"></td>
</tr>
</table>
这是在ie模式下
你可以将input标签的onclick设置为不冒泡方式,就可以实现只有input标签响应onclick,举例如下:
<table border=1 width=100>
<tr οnclick="alert('td')">
<td><input type="checkbox" οnclick="window.event.cancelBubble=true;alert('input')"></td>
</tr>
</table>
这是在ie模式下