How to detect a click outside an element?

Posted by Sergio del Amo on Stack Overflow See other posts from Stack Overflow or by Sergio del Amo
Published on 2008-09-30T13:17:12Z Indexed on 2010/04/05 10:13 UTC
Read the original article Hit count: 354

Filed under:
|

I have some html menus, which i show completely when a user clicks on the head of these menus. I would like to hide these elements when the user clicks outside the menus area.

Is something like this possible with jquery?

$("#menuscontainer").clickOutsideThisElement(function() {
// hide the menus
});

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery