LESSON 1
What is JavaScript?
Learning objective: Understand what JavaScript is and what it adds to a web page.
Understand
JavaScript is the programming language that makes web pages interactive.
HTML gives structure and CSS gives style; JavaScript adds behaviour — responding to clicks, updating content, validating forms, and much more. It runs right in the browser.
Analogy: If HTML is the body and CSS is the appearance, JavaScript is the muscles that make things move.
See It in Action
A one-line greeting:
alert("Hello from JavaScript!");How it works:
alert() is a built-in function that pops up a message — proof that your JavaScript is running.Try It Yourself
- Add a
<script>tag to an HTML page. - Put an
alert()inside it. - Open the page and see the popup.
Quick Quiz
What does JavaScript primarily add to a page?
Challenge
Make a page show an alert when it loads.
Success condition: Your page runs JavaScript and shows a message.
+10 XP
Lesson Complete
You answered correctly and completed the required practice. Your progress has been saved on this device.
Continue to next lesson →