I have this jQuery code where I have a click event on a <tr>. This event should not trigger when I click on a specific <td>. The code that I have now does this just great, but now I want to add one more condition where the event on the <tr> should not trigger when it's clicked.
I want to add a <span></span> which, if clicked, does trigger the event on the <tr>.
Here is my code:
// Change background color on rows in new candidates list
$(".newCandidatesTableTr td:not(#testTD) span:not(#candidateID)").click(function() {
$(this).parent().siblings().removeClass("diffColor");
$(this).parent().toggleClass("diffColor", this.clicked);
});
This doesn't work:
span:not(#candidateID)
How should I do this?