Hello, having some problem with javascription.
What I'm trying to accomplish is:
1. on default, div#options-dropdown is hidden.
2. When user clicks on div#options, #options-dropdown shows up.
3. After that, when a user clicks on any part of the browser other than #options-dropdown, the #options-dropdown hides.
Here is the code:
Code:
$(document).ready(function() {
$(document).click(function(event) {
$("#options-dropdown").hide();
if ((event.target == $('#options-dropdown')) && (event.target == $('#options'))) {
$("#options-dropdown").show();
}
});
});
Thanks in advance!