There are no tracking or monitoring cookies on this site. There are only cookies used for documentation examples related to cookies.
Close

Processing...
This may take a few seconds.

The "clickoutside" event

"clickoutside" is a custom Active CSS event which allows you to trap if someone has clicked outside of the target selector in the DOM tree.

To use this event, you need to activate it by using the clickoutside-event command. Once you have done this, the clickoutside event will work.

This was built initially for the purpose of knowing if the user has clicked outside of a form, but it can be used for other purposes such as closing up a menu when you click away from it.

Here is a simple example:

#myForm:clickoutside {
    alert: "You clicked outside the form.";
}

This won't work on parent windows of inner iframe elements that have a clickoutside event. It did at one point, but for security considerations it was removed.