Course Content
Module 1: Introduction to JavaScript
0/1
Lesson 2 Variables, Data Types & Operators
0/1
Lesson 3 Conditional Statements
0/1
Lesson 4 Loops
0/1
Lesson 5 Functions
0/1
Lesson 6 Arrays & Objects
0/1
Lesson 7 DOM Introduction
0/1
Lesson 8 Event Handling
0/1
Lesson 9 ES6 Basics
0/1
JavaScript for Beginners: From Zero to Building Interactive Web Apps

Event Handling

onclick, onchange, onsubmit

addEventListener

🧪 Practice:

Change background color when a button is clicked

✅ Example:

 
<button onclick="changeColor()">Change Color</button>

<script>
function changeColor() {
document.body.style.backgroundColor = "lightblue";
}
</script>