I'm working on drop down menu with css and jquery. I wish to be menu open until I click something or until I click out of the menu.
This is what I have tried:
$('#optionButton').click(function() {
$('#dropMenu').css('visibility' , 'visible') //optionButton clicked, menu visible
});
$('*').not('#optionButton').click(function() {
$('#dropMenu').css('visibility' , 'hidden') //clicked eanithing else: menu close
});
But it doesn't work how I expected.