How to stop parent event trigger while clicking child event?
CODE:
$('body').on('click', 'cs-placeholder', function(e) {
//* Disable dropdown in modals that aren't contacts
if( $(e.target).parents(".modal").length === 0 || $(e.target).parents("#contact").length === 1 ) {
if($(this).hasClass('active')) {
alert('close');
$(this).removeClass('active');
}
} else {
alert('open');
$('.cs-placeholder').removeClass('active');
$(this).toggleClass('active');
}
}