Instead of listening to every single click on the DOM to hide one specific element, you could set tabindex
to the parent and listen to the
focusout
events.
Setting tabindex
will make sure that the blur
event is fired on the (normally it wouldn't).
So your HTML would look like:
And your JS:
$('.form_wrapper').on('focusout', function(event){
$('.form_wrapper').hide();
});