on out side click hide div code example
Example: div click outside to hide javascript
$(document).click(function(){
$("#try").hide();
});
$("#try").click(function(e){
e.stopPropagation();
});
$(document).click(function(){
$("#try").hide();
});
$("#try").click(function(e){
e.stopPropagation();
});