You can use the event
click argument and see if the click is inside another element (or the element itself)
JSFiddle: https://jsfiddle.net/32mz2x3x/1/
$("#pop_up").click(function(event) {
if ($(event.target).parents().andSelf().is('#pop_up_content')) {
return
}
$("#pop_up").hide();
});
parents
, pop_up_content
, andSelf
, , , #pop_up_content
( )
: