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

WBOY
WBOYOriginal
2016-05-16 17:58:051186browse

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:


< div id="myDiv">
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
Previous article:A brief discussion on js change, propertychange, input events_javascript skillsNext article:A brief discussion on js change, propertychange, input events_javascript skills

Related articles

See more