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.
The operating environment of this tutorial: windows10 system, jquery3.2.1 version, Dell G3 computer.
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>
Output result:
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!