Services Work Learn About Contact
0/10
Lesson 9 of 10

Events

Events are actions that happen in the browser, like clicks, key presses, or page loads. Use addEventListener() to run code when an event happens.

JS
const btn = document.querySelector("button");

btn.addEventListener("click", () => {
  alert("Button clicked!");
});
🧠

Quick Quiz

Answer correctly to unlock the next lesson.

Support the mission

This learning platform is 100% free: no ads, no tracking, no paywalls. If it helped you learn something useful, you can support future lessons or donate to Doctors Without Borders, which provides emergency medical care in crisis zones worldwide.

🎉

You completed JavaScript!

You finished all 10 lessons and quizzes. You now know the basics of JavaScript.