I have nested event listeners. Exactly they are
<tr onclick="function1();">
<td>....</td>
<td onclick="function2();">....</td>
</tr>
When Second Cell is clicked, only function2() should be called and not function1(). Is there any way to do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The event can be stopped using event.stopPropagation
See the answer here for more discussion: How to stop event propagation with inline onclick attribute?