Skip to content
Advertisement

Javascript onmouseover stop menu

I have this small menu. All I want is to open it with one click and then to close it with another click outside the html element.

I figured out only how to open it with a click but don’t know how to close it:

  • HTML portion:
JavaScript
  • JavaScript code:
JavaScript

Advertisement

Answer

One solution is using an if condition:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement