Link to home
Start Free TrialLog in
Avatar of nikdonovanau
nikdonovanau

asked on

Javascript If click outside layer

Hi Experts

I have a div layer that appears onclick.

My question is that to hide the layer I have a X with a onclick style.display='none'

How can i make it so that if I click anywhere on the screen that is not in the layer, the layer hides?

Cheers
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nikdonovanau
nikdonovanau

ASKER

Thanks for that :)