Basically trying to remove/toggle the 'active' class from the div, but if I click inside the children of 'parent-div' the function happens as well, and it should only work on the parent-div. It's a fixed background that should act as "click outside to close" function, and I can't disable clicking inside the children because there is a form inside in them.
Tried event.stopPropagation as well but that didn't do anything.
HTML
<div class="ims-search active">
<div class="ims-search-content">
<div class=ims-search-input">
<form>
</form>
</div>
</div>
</div>
$(".ims-search").click(function(event){
if (!$(event.target).is('.ims-search .active')){
$(this).removeClass('active');
}
});