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
WBOYOriginal
2016-05-16 16:41:021797browse

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>
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