Home > Web Front-end > JS Tutorial > body text

Usage explanation of event.preventDefault() function in js

巴扎黑
Release: 2017-07-22 15:20:07
Original
2615 people have browsed it

1. First, event.preventDefault() notifies the browser not to perform the default action associated with the event, for example:

The default event of the a tag here is jump , here we tell the browser to cancel the default event, so that the jump function of the a tag will not work. On the contrary, the a standard restore default event function is as follows:

The above is the detailed content of Usage explanation of event.preventDefault() function in js. For more information, please follow other related articles on the PHP Chinese website!

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