I have a table row with one of the td containing a button. I want to be able to click the tr and have that trigger a function. However, I do not want this function to be triggered if the button within the td is clicked. My current method is by using a :not selector on the td of the button but i would prefer to use the button itself. The class noclick is the class of the button parent td.
$('#mytable td:not(.noclick)').on('click',function(){
EDIT: for clarification
<tr data-x="test">
<td>NAme</td>
<td>Phone</td>
<td class="noclick"> // this is where the current not selector works
<button>X</button> // this button is the only place I want the not selector to work
</td>
</tr>
So to clarify I want a similar process to my posted handler but instead I want the buttons parent td to work for the click function and not work for the button itself.
I have tried a few different things including still using the td but trying to make the td a minimal size. I was not able to get the td to become smaller.