Last Updated: September 09, 2019
·
24.25K
· craigmdennis

Close dropdowns by clicking outside of them with jQuery

$(document).ready( function(){

$('#trigger').click( function(event){
    event.stopPropagation();
    $('#drop').toggle();
});

$(document).click( function(){
    $('#drop').hide();
});

});

1 Response
Add your response

$(function(){
$(document).on("click", function(e){
console.log("h");
});
});
Not working. https://jaygujaratgarvi.blogspot.com

over 1 year ago ·