๐ฏ By the end of this lesson you canโฆ
- Explain what JavaScript does on a web page
- Name the three languages of the web and their jobs
- Run a line of JavaScript
The three languages of every web page
| Language | Job | Example |
|---|---|---|
| HTML | Structure: what is on the page | a button, a heading, a form |
| CSS | Style: how it looks | the button is purple and round |
| JavaScript | Behaviour: what happens | clicking the button adds an item to your cart |
Every time a web page reacts to you โ a like counter going up, a menu sliding open, a form saying “that email looks wrong” โ JavaScript is running.
Your first line
โก JavaScript
first.js
๐ Tap a line to explain it
1console.log("Hello, world! ๐");2console.log(2 + 3);
Press โถ Run. Then press โ๏ธ Edit, change the message to your name and run it again. You are now a JavaScript programmer.
Where JavaScript runs
- In the browser: every website. Your browser has a JavaScript engine built in (Chromeโs is called V8).
- On servers and your computer: with Node.js, the same language builds servers, tools and apps.
- In these lessons: safely inside the page, whenever you press โถ Run.
๐ก Concept check
Which language controls what happens when you click a button?
๐ฎ What will this display?
What does this print?
1console.log(10 - 4);
๐ ๏ธ Say hello
Print exactly Hello, LearnWith!
๐ Key takeaways
- HTML = structure, CSS = style, JavaScript = behaviour.
- JavaScript runs in every browser โ and on servers with Node.js.
console.log(...)prints a message: your window into the program.
Finished reading & practising?
Saved in this browser. Create a free account to keep it forever.