Home > Web Front-end > Front-end Q&A > what are jquery events

what are jquery events

WBOY
Release: 2022-03-29 10:18:11
Original
1758 people have browsed it

jquery events refer to the page's response to different visitors, and the method called when certain events occur in HTML is the event handler; there are six basic jquery events, namely page events, Mouse events, keyboard events, form events, edit events and scroll events.

what are jquery events

The operating environment of this tutorial: windows10 system, jquery3.2.1 version, Dell G3 computer.

What are jquery events

The response of the page to different visitors is called an event.

Event handlers refer to methods that are called when certain events occur in HTML.

jQuery has the following 6 basic events. Page events; mouse events; keyboard events; form events; edit events; scroll events.

When we click a button, a dialog box will pop up. Among them, "click" is an event, and "pop-up dialog box" is some of the things we do in the click event.

The example is as follows:

click() method is a function that is called when the button click event is triggered.

This function is executed when the user clicks on the HTML element.

In the following example, when a click event is triggered on a

element, the current

element is hidden:

<html>
<head>
<meta charset="utf-8"> 
<title>123</title> 
<script src="js/jquery.min.js">
</script>
<script>
$(document).ready(function(){
  $("p").click(function(){
    $(this).hide();
  });
});
</script>
</head>
<body>
<p>如果你点我,我就会消失。</p>
<p>点我消失!</p>
<p>点我也消失!</p>
</body>
</html>
Copy after login

Output result:

what are jquery events

Recommended related video tutorials: jQuery video tutorial

The above is the detailed content of what are jquery events. 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