I need to hide a table when clicked outside the table. The table is inside a div. Also there are some ul and li elements inside the table.
I'm checking whether the target node is having the same id as of that of the div, if not then hide the div.
But the problem is when the user clicks on the list items inside table, the target is different. I think getting navigating to the top of the DOM structure is not a good practice. Is there any method, by which we can listen to the events if it originate from the DIV.
Please give your suggestions. Any help will be appreciated.