🎯 Learning Objectives
By the end of this lecture, students will be able to:
- Understand what JavaScript Events are
- Know how events connect users and the browser
- Use
addEventListener() correctly
- Work with common mouse, keyboard, and form events
- Understand the event object
- Learn event bubbling and capturing (conceptually)
- Prevent default browser behavior
- Build interactive features using events
#️⃣ 1. What are JavaScript Events?
Events are actions or occurrences that happen in the browser.
They are usually triggered by the user, but sometimes by the browser itself.
Common examples:
- Clicking a button
- Typing on the keyboard
- Moving the mouse
- Submitting a form
- Scrolling the page