I have a dynamically appended menu which I am removing if you click anywhere on page including the menu links itself. What I am trying to achieve is to prevent the remove if yo
You can also detect clicks on the whole document and check if the current element clicked is your menu element
$(document).click(function(event){ if(event.target !== $('.menu')[0]) { // hide the menu... } });