amitabhaghosh197
12/23/2015 - 3:08 PM

body-click-js

body-click-js

$('body').click(function(evt){    
       if(evt.target.id == "menu_content")
          return;
       //For descendants of menu_content being clicked, remove this check if you do not want to put constraint on descendants.
       if($(evt.target).closest('#menu_content').length)
          return;             

      //Do processing of click event here for every element except with id menu_content

});

//reff: http://stackoverflow.com/questions/12661797/jquery-click-anywhere-in-the-page-except-on-1-div