michelle
09-04-2003, 09:10 AM
I have two onClicks in a table as show in the table below.
Since the "a href" is in the area of the "TD", I get two alerts.
I just want the alert('href') to be called if I click on the link and alert('td') to be called if I click anywhere else in the TD.
Any thoughts?
// Michelle
<table border=1>
<tr>
<td onclick="alert('td');">
<a href="#" onClick="alert('href')">a link</a>
<br>
<br>Not a link
</td>
</tr>
</table>
Since the "a href" is in the area of the "TD", I get two alerts.
I just want the alert('href') to be called if I click on the link and alert('td') to be called if I click anywhere else in the TD.
Any thoughts?
// Michelle
<table border=1>
<tr>
<td onclick="alert('td');">
<a href="#" onClick="alert('href')">a link</a>
<br>
<br>Not a link
</td>
</tr>
</table>