When I click a button, then a drop down menu must be shown. When I click anywhere in the page it, needs to hide. The problem I have is here: when I run the page, I can see the drop down menu instead of the click event. I tried with different div tags, but to no effect.
When I click a button, then a drop down menu must be shown. When
Share
You need to set your dropdown list visibility to false (to hide it) when page loads.
After that, when you click the button you set visibility to true (show it).