Jquery events are used to perform special actions on the selected elements in jquery. There are three types of events in Jquery, we can take in use which are following-
#1. Primary Event
There is only one primary event in Jquery, called ready(). We define an anonymous function in the ready() event.
Whole Jquery code is written in the anonymous function, defined in the ready() event.
<body>
<script>
$(document).ready(function(){
window.alert("Jaischool");
});
</script>
</body>
#2. Secondary Event
It contains so many events like mouse events, keyboard events, form events & document or window events related events.
#2.1 Mouse Events in Jquery
Mouse Events | Example |
---|---|
click() | See Example |
dblclick() | See Example |
mouseenter() | See example |
mouseleave() | See example |
#2.2 Keyboard Events in Jquery
#2.3 Form Events in Jquery
Form Events | Form Event Example |
---|---|
submit() | Submit() event example |
change() | change() event example |
focus() | focus() event example |
blur() | blur() event example |
#2.3 Document or Window Events in Jquery
Document/window Events | Example |
---|---|
load() | load() Event Example |
unload() | unload() Event Example |
resize() | resize() Event Example |
scroll() | scroll() Event Example |
Publish A Comment