Home >Web Front-end >JS Tutorial >js event bubbling example sharing (tested)_javascript skills

js event bubbling example sharing (tested)_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:35:391056browse

Examples on the Internet use $(".b").live("click",function(event){}. jquery automatically handles live and prevents events from bubbling. Change it to bind and the experiment will pass.

Copy code The code is as follows:

< !DOCTYPE html PUBLIC "-//W3C/ /DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> .org/1999/xhtml">


Untitled Document





wrapwrapwrapwrapwrapwrapwrap
This is the announcement title 1

This is the announcement title 2

This is announcement title 3


wrapwrapwrapwrapwrapwrapwrap




In the above code Add or not

Copy code The code is as follows:
event.stopPropagation();

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