In this lesson, you learned a few of the most common mouse events in the jQuery library.
- Event handlers are comprised of an event listener and a callback function. An event listener specifies the type of event that will be detected. The callback function executes when the event happens. Everything together is the event handler.
- An event listener is set up using the
- The events listened for included:
- In addition to event handlers, you learned how to use
event.currentTargetto refer to the individual element that an event occurred on.
Well done! At this point, you understand the purpose of an event, and how to link it to a callback function. Use jqapi.com to learn about some other events that jQuery has to offer. Select Events in the left navigation bar to browse these other events.
If you want a challenge, try to add some new events to the Sole Shoes website — use the list event listeners below to help.
Though they are not used as frequently, jQuery also supports keyboard events. If you’re looking for a challenge, give the following event listeners a try: