How do I disable onclick event of one cell?

B

Barton

Hello,

I've got a table row with an onClick event that loads page1.
Now I do not want to apply this event to one cell of that row because
that cell contains already a link to another page. How do I disable
the onClick event on that one cell? Code:

<table>
<tr onClick="window.location=page1.html'>
<td></td>
<td></td>
<td></td>
<td></td>
<td><a href="page2.html"></td>
</tr>
</table>

Thnx,

Barton
 
M

Martin Honnen

Barton said:
I've got a table row with an onClick event that loads page1.
Now I do not want to apply this event to one cell of that row because
that cell contains already a link to another page. How do I disable
the onClick event on that one cell? Code:

<table>
<tr onClick="window.location=page1.html'>
<td></td>
<td></td>
<td></td>
<td></td>
<td><a href="page2.html"></td>

Try
<a onclick="if (event.stopPropagation) {
event.stopPropagation;
}
event.cancelBubble = true;
return true;"
href="page2.html">link</a>
 
L

Lasse Reichstein Nielsen

Martin Honnen said:
<a onclick="if (event.stopPropagation) {
event.stopPropagation;

Should be: event.stopPropagation();

Otherwise I agree completely.
/L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top