jQuery TutorialLesson 6Free preview
jQuery Events
This lesson is part of jQuery · All levels
Summary
jQuery events are a way of handling user interactions like clicks, mouse movements, and keyboard buttons. Each event has a special method such as click() and keydown(), and all of them can be rewritten with a more flexible on(). With on(), one hand can be used for many types of events as well as special events such as hover().
Key points
- Common event: click, dblclick, mouseenter, mouseleave, keydown, submit
- The callback function runs whenever an incident occurs.
- The on() method is a common and flexible way to set up many events
- This in the callback indicates the element that triggers the event
- Event can be prevented by preventDefault() for example on submit form
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.