I have a div inside form something like
You can do what you want like this:
$(document).click(function() {
$("#idshow").hide();
});
$("#idshow").click(function(e) {
e.stopPropagation();
});
What happens here is when you click, the click event bubbles up all the way to document, if it gets there we hide the document by using event.stopPropagation()...so the .hide() doesn't fire, short and simple :)