取消表中一列的onclick事件

use*_*778 1 html javascript onclick

我已经做了一些挖掘,但却无法找到解决这个小问题的方法.我有一个表格,我可以使用以下方法点击每一行:

<tr class="clickable" onclick="window.document.location='$link';">

我希望除了表格中的最后一列之外的所有内容都可以使用,但到目前为止我找到的所有解决方案都涉及jQuery.有没有办法"取消"一列的行onclick事件?

TIA

Roh*_*wal 7

这是代码 - http://jsbin.com/iLISUDu/2/

  <!DOCTYPE html>
  <html>
  <head>
  <meta charset=utf-8 />
  <title>JS Bin</title>
  </head>
  <body>
    <table>
      <tr onclick='window.location.href="google.com";'>
        <td>Hello</td>
        <td>We are cells</td>
        <td onclick='event.stopPropagation();return false;'>Click Me</td>
      </tr>
    </table>
  </body>
  </html>
Run Code Online (Sandbox Code Playgroud)

  • 找到解决方案:删除"returan false",它似乎按预期工作. (2认同)