Really simple jquery question here that I have yet to resolve. I have the following html table
<table id="table-1">
<tr>
<td>Value 1</td>
<td>Value 2</td>
<td>
<button id="btn-1" value="Go"></button>
</td>
</tr>
</table>
I have the following event listener for when the table row is clicked
$("table-1 tr").on(
'click',
function(e){
if(button was clicked){
//do some stuff
} else {
//do different stuff
}
}
);
I'd like this event listener to fire whenever the table row is selected, except for when the clicked item is my button. I've been trying to use :not
and .not()
, but no luck. Any ideas?