i have structure like this
<table><tr><td></td><td><input type="button" name="button"></td></tr></table>
<script>
$('tr').click(function(){window.alert('tr');})
$(':input').click(function(){window.alert('input');})
</script>
when i click on the button, tr click event also called. is there any way to disable click event on parent element? the only solution i found is to add class to parent element and inside its click function check for it. for example:
<script>
$('tr').click(function(){ if(!$(this).hasClass('disable')) { window.alert('tr'); } $(this).removeClass('disable'); })
$(':input').click(function(){window.alert('input'); $(this).closest('tr').addClass('disable');})
</script>