Events in jQuery
Events in
jQuery
What are the
events ?
Events are
the some special moments on web pages, when a user do something or perform some
action on a web page, these actions are called events.
These action
may be of any action like press any key on keyboard, click mouse, double click
mouse or submit a form and many more.
The term ‘fires’
or ‘fired’ is used with events which means happening an event. When an event
performed or happened mean the events is fired.
Now if we
talk about events in jQuery, We can divide events in some categories.
1. Mouse events
2. Keyboard events
3. Form events
4. Document events
Events in
jQuery are methods or functions.
For every
event there is a function related to that event and that function or method is
used to apply that event on any element on a web page.
The syntax
for the above will be –
Syntax - $(“element”).event_method()
;
If we want
to perform some action when an event fires, we have to use a function for that
action. The syntax for this will be –
$(“element”).event_method(function(){
// The action
goes here…
});
Now we will
discuss each of those categories one by one in detail in coming chapters.
Comments
Post a Comment