0

I am having a table inside a TD of another table. the parent TD has a function to be executed on clicking. So how to add a event for the child table. I cant able to add a event for child table. The parent TD's event is fired.

Tushar
  • 4,280
  • 5
  • 24
  • 39

1 Answers1

0

You can do it like this

HTML

<table >
    <tr>
        <td class="outer">
            Outer

      <table>
        <tr>
            <td class="inner" >Inner</td>
        </tr>
      </table>
        </td>
    </tr>
</table>

jQuery

$('.outer').click(function(){
  alert('test')
})

$('.inner').click(function(e){
  e.stopPropagation();
})
Tushar
  • 4,280
  • 5
  • 24
  • 39