In this tutorial you’ll learn how to use events in jQuery. Events are fundamental to most JavaScript web apps. Using events, your code can respond to things happening in the browser, such as the user clicking a button, entering text into a form field, or submitting a form.
This tutorial isn’t a comprehensive reference, but it includes the stuff that you’ll need when writing the majority of your scripts. Here’s a full list of the jQuery event methods and properties should you need it.
You’ll explore the following topics in this tutorial:
- What is an event?
- Working with events
- A simple event handler example
- Shortcut methods for binding common events
- Accessing the element from within the event handler
- Getting more information about an event
- Stopping default actions and event propagation
- Cancelling event handlers
- Triggering events yourself