Keyboard and Mouse Events
Handle clicks, key presses, and pointer events.
Input Event Families
Mouse and keyboard events let you build rich interactions. Each family has specialized event types and properties.
The click Event
click fires on a primary press-and-release. It also fires for keyboard activation on buttons and links, making it accessible.
btn.addEventListener("click", () => {
console.log("activated");
});All lessons in this course
- addEventListener Basics
- The Event Object
- preventDefault and stopPropagation
- Keyboard and Mouse Events