jQuery Tutorial
jQuery Events: Explained in Simple Terms
What are Events in jQuery?
Events are the different visitor actions that a web page can respond to.
A jQuery event is a representation of the exact moment when something occurs.
Examples of events in jQuery
-
dragging the mouse over a component
-
selecting a radio button
-
selecting an element
The term "fires/fired" is frequently used for events.
Here are a few examples of DOM events:
jQuery Syntax For Event Methods
Most DOM events have an equivalent jQuery method in jQuery.
You can do the following to assign a click event to all paragraphs on a page:
$("p"). click();
The following step is to specify what should happen if the event occurs. But, first, a function must be passed to the event:
$("p").click(function(){
// enter your action here!!
});