Home > Web Front-end > JS Tutorial > jquery prevents subsequent events from executing only the first event_jquery

jquery prevents subsequent events from executing only the first event_jquery

WBOY
Release: 2016-05-16 16:41:02
Original
1803 people have browsed it

Sometimes you encounter multiple events after clicking on the same label. If you only want to execute the first event and abandon the subsequent events, you can add a piece of code to prevent it:

<span onclick="alert('后面的不会执行了!');event.stopPropagation();">click me!</span>
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template