I've done some digging and been unable to find a solution to this little problem. I have a table where I've made each row clickable using:
<tr class="clickable" onclick="window.document.location='$link';">
I'd like to make this work for all but the last column in the table but all the solutions I've found so far involve jQuery. Is there a way of "cancelling" the row onclick event for one column?
TIA
Here is the code - 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>
Click events can be cancelled by returning false from the handler event.
try
<td onclick="(function(e){e.preventDefault();})">A</td>