Book a free demo

๐ŸŽญ Interactive lesson ยท Grade 10 ยท about 90 minutes

Your first steps in JavaScript: play first, then code.

See how HTML, CSS and JavaScript work together, aim a laser at a page element, drop values into memory boxes, sort data types and test every operator. Then build four small web pages step by step and watch them run in a live preview.

  • Grade 10 (ages 14-16)
  • 4 guided coding activities
  • Live page preview
  • Free jump for teachers
  • Free ยท no sign-up
ShareWhatsApp

Loading the lessonโ€ฆ

What students learn

  • What JavaScript adds to HTML and CSS, and what Node.js does outside the browser
  • Writing code between <script> tags and leaving notes with // comments
  • Finding a page element with document.getElementById("id") and changing it with .innerHTML
  • Creating variables with var, the = sign, and the 4 naming rules
  • Statements and semicolons, and the data types Number, String, Boolean and Object
  • Arithmetic operators + - * / % and assignment operators = += -= *= /=

The ten modules

  1. The Puppeteer Studio. Switch on HTML, then CSS, then JavaScript to see the same page get a skeleton, an outfit and a puppeteer, then compare the browser with the Node.js kitchen.
  2. The DOM Laser Grabber. Choose an id, type a message and fire getElementById to fill a box, and see which lines the computer ignores.
  3. Guided Activity 1: syntax and comments. Five steps in a live editor with a preview: ids, a script tag, two comments and two innerHTML lines.
  4. The Memory Box Factory. Drop values into var boxes, watch a sum appear, and play the Variable Name Bouncer on the four naming rules.
  5. Guided Activity 2: variables. Ten steps from DOCTYPE to the finished sum page, with sliders to change num1 and num2.
  6. The Recipe Sequencer and Type Sorter. Step through four statements and sort Number, String, Boolean and Object values.
  7. Guided Activity 3: statements. Ten steps: declare x, y and z, give them values, add them and show z.
  8. The Math and Combo Machine. Test + - * / % with a cookie-sharing picture of the remainder, and the += -= *= /= power-ups.
  9. Guided Activity 4: operators. Eleven steps plus an Operator Switcher that changes the operator in your own code.
  10. Eye break, summary and certificate. A calm figure-8 eye exercise, revision cards, practice tasks and a JavaScript Explorer certificate with all four .html files.

FAQ

JavaScript introduction: common questions

What is JavaScript used for?

JavaScript is the programming language that makes web pages interactive. HTML builds the structure, CSS styles it, and JavaScript adds behaviour such as reacting to clicks, doing calculations and changing what the page shows.

What is Node.js?

Node.js lets you run JavaScript outside the browser, on your own computer or on a server. In a classroom it is often used with VS Code and the Code Runner extension to run JavaScript files and see the output in a terminal.

What does document.getElementById do?

It finds the element on the page that has a matching id. You can then change what is inside it with .innerHTML, for example document.getElementById("demo").innerHTML = "Hello";

What are the rules for naming a JavaScript variable?

A name cannot start with a number, it is case-sensitive (score and Score are different), it cannot be a reserved keyword such as var, and it cannot contain spaces. Letters, digits, underscores and dollar signs are allowed.

What are the JavaScript data types?

Common data types are Number (10 or 10.567), String (text in quotes), Boolean (true or false without quotes) and Object (values grouped in curly braces). Note that "true" in quotes is a String, not a Boolean.

What does the % operator do in JavaScript?

The % operator gives the remainder after division. For example 5 % 2 is 1, because 5 shared into groups of 2 leaves 1 over.

Start a conversation

Questions about coding classes?

Tell us the learner's age and level and we'll suggest a starting point and confirm the format before anything is booked.

  • Tell us the learnerโ€™s age or grade and goals
  • Weโ€™ll suggest a suitable class or learning path
  • Weโ€™ll confirm format, timing and fees with a parent or guardian

For a childโ€™s class, please have a parent or guardian send the enquiry. Avoid sharing passwords or sensitive personal details.

Weโ€™ll use your details only to respond to this request.

Play it, don't just read it

Take a break and play

Free games that need no sign-up. Pick one and play for five minutes.

All free games โ†’
Chat on WhatsApp
Esc

Try