1 reply [Last post]
kiwis
kiwis's picture
Offline
Enthusiast
Last seen: 1 year 18 weeks ago
Timezone: GMT+12
Joined: 2009-03-07
Posts: 68
Points: 108

i'm opening my login div on a button click, how can i close it but clicking elsewhere on the page or the esc key

<li><a href="#" onClick="document.getElementById('login').style.visibility= 'visible';">Login</a></li>

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 6 days 14 hours ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5344
Points: 2965

Hi kiwis, Put

Hi kiwis,
Put
onClick="document.getElementById('login').style.visibility= 'hidden';" where you want to click to hide the div.