jQuery — Events Reference
Mouse Events
| Event | Description |
|---|---|
| click | Mouse click |
| dblclick | Double click |
| mousedown | Mouse button pressed |
| mouseup | Mouse button released |
| mouseenter | Mouse enters element |
| mouseleave | Mouse leaves element |
| mousemove | Mouse moves |
| mouseover | Mouse over element |
| mouseout | Mouse leaves element |
| hover | Enter + leave combined |
Keyboard Events
| Event | Description |
|---|---|
| keydown | Key pressed down |
| keyup | Key released |
| keypress | Key pressed (deprecated) |
Form Events
| Event | Description |
|---|---|
| submit | Form submitted |
| change | Input value changed |
| focus | Element gains focus |
| blur | Element loses focus |
| focusin | Focus bubbles |
| focusout | Blur bubbles |
Document Events
| Event | Description |
|---|---|
| ready | DOM loaded |
| load | Page fully loaded |
| resize | Window resized |
| scroll | Page scrolled |
| unload | Page unloaded |
Event Methods
// Bind
$("p").on("click", handler);
$("p").click(handler);
// Unbind
$("p").off("click", handler);
// One-time
$("p").one("click", handler);
// Trigger
$("p").trigger("click");
Event Object Properties
$("p").on("click", function(event) {
event.type; // "click"
event.target; // Clicked element
event.pageX; // Mouse X
event.pageY; // Mouse Y
event.which; // Button/key code
event.metaKey; // Ctrl/Cmd held
});
Mini Practice
- Bind all mouse events to a div
- Use the event object for coordinates
- Trigger a click programmatically
- Bind and unbind events
Up Next
Continue with Effects Reference — complete list of jQuery effects.
Related Topics
Frequently Asked Questions about Events Reference
What is Events Reference in jQuery?
Events Reference is a fundamental concept in jQuery. This lesson explains it step by step with clear examples, making it easy for beginners to understand.
How do I learn Events Reference?
Start by reading the explanation above, then try the code examples. Practice by modifying the examples and experimenting with different values. Hands-on practice is the best way to learn Events Reference.
Why is Events Reference important in jQuery?
Events Reference is essential for jQuery development. Understanding this concept will help you write better code and solve real-world problems more effectively.