Home >Web Front-end >JS Tutorial >Implementation code for closing DIV after clicking outside area of ​​DIV_jquery

Implementation code for closing DIV after clicking outside area of ​​DIV_jquery

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-16 17:58:051277browse

Prevent bubbling:
1. stopPropagation() for non-IE browsers.
2. The cancelBubble attribute is true. For IE browser,
and Jquery already has a browser-compatible method, event.stopImmediatePropagation();

Copy Code The code is as follows:



This is a div;



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn