Popup
Fri, Jan 24, 2014

Often is needed to close a popup when the user clicks anywhere else in the page but not on popup. There are many workarounds for such functionality, including one of the simplest which is to give to the div the tabindex attribute and use onblur event.

But onblur wasn’t suitable for me because is fired only if the popup have got the focus, and the user may want to close that popup without giving the focus to it.