Advertisement
Google Ad Slot: content-top
jQuery Events
What Are jQuery Events?
Events are actions that happen in the browser — like when a user clicks a button, hovers over text, types into a form, or when a page finishes loading.
jQuery makes it super easy to detect and respond to these events using simple methods.
Mouse Event |
Eeyboard Event |
Form Event |
|---|---|---|
click() |
keydown() |
focus() |
dblclick() |
keypress() |
blur() |
mouseenter() |
keyup() |
change() |
mouseleave() |
submit() |
|
mousedown() |
||
mouseup() |
||
hover() |
Mouse Event
These trigger when the user interacts with the mouse.
1) click() Event
Fires when an element is clicked
2) dblclick() Event
Fires when an element is double-clicked
3) mouseenter() Event
Fires when the mouse enters an element
4) mouseleave() Event
Fires when the mouse leaves an element
5) mouseup() Event
When mouse button is pressed down
6) mousedown() Event
When mouse button is released
7) hover() Event
Shortcut for mouseenter + mouseleave
Keyboards Event
1) keydown() Event
Fires when a key is released
2) keyup() Event
Fires when a key is pressed down
3) keypress() Event
The keypress event in jQuery is triggered when the user presses a key on the keyboard. It works primarily for character keys (like letters and numbers), but does not detect non-character keys (like Shift, Esc, or Arrow keys).
Form Events
1) focus() Event
Fires when an element gains focus
2) blur() Event
Fires when an element loses focus
3) change() Event
Fires when the value of an element changes
4) submit() Event
Fires when a form is submitted