JavaScript for Beginners
Make web pages interactive with the language every browser speaks
A free, complete JavaScript course for beginners who know some HTML and CSS. Learn variables, conditions, loops, functions, objects and array methods, then the DOM, events, forms, localStorage and fetch, with live interactive examples, exercises with solutions and a quiz in every lesson. Finish by building a to-do list app.
- lessons
- 13
- lessons
- final project
- 1
- final project
- of learning
- 11 hours
- of learning
- level
- Beginner
- level
Who this course is for
- Learners who have finished HTML & CSS (or know the basics) and want to make pages interactive
- Students and job-seekers heading towards front-end, full-stack or QA automation roles
- Designers and marketers who want to understand and adjust website scripts
- Python learners who want a second language for the web
What you will be able to do
- Write JavaScript with variables, conditions, loops and functions, and read error messages in the console
- Work with arrays and objects using map, filter, find, reduce and sort
- Find and change page elements, and respond to clicks, typing and form submissions
- Validate form input and show accessible error messages
- Save data with localStorage and JSON, and load data from the web with fetch
- Build a complete to-do list app that remembers your tasks
Before you start
Skills you need
- Basic HTML and CSS: elements, classes, ids, linking a stylesheet (the HTML & CSS for Beginners course covers all of it)
- No programming experience needed
Cost and accounts
Free. No account, card or paid software needed.
Setup time
About 5 minutes to create a practice folder with an HTML file and a script file (lesson 1).
Tools
- A code editor: Visual Studio Code ↗Free for Windows, macOS and Linux. Any plain-text editor also works.
- Google Chrome or Microsoft EdgeAny modern browser runs the code. Console output in the lessons is shown the way Chrome and Edge display it; Firefox and Safari show the same values in a slightly different style.
- A laptop or desktop computerPhones are fine for reading and trying the live examples, but you need a computer to write your own files.
Checked with
- Every console example is run automatically in Node.js 24 (the same V8 JavaScript engine as Chrome) and its output compared with the lesson
- Every page example is loaded in jsdom 31.0.1, clicked and typed into by an automated test, and checked; its HTML and CSS pass html-validate 11.22.1 and css-tree 3.2.1
- Live previews were tried in Google Chrome 158 at phone and desktop widths
Last reviewed: 26 November 2026
Syllabus
Module 1: JavaScript basics
The console, variables, types, operators, decisions, arrays, loops and functions.
- 1Your first JavaScript: the console and a script fileLearn what JavaScript does in a web page, connect a script file to your HTML, print messages with console.log, read errors in the browser console, and change a page with one line of code.35 min
- 2Variables and data typesStore values in JavaScript variables with let and const, name them clearly, and work with strings, numbers, booleans, undefined and null, using typeof and template literals.30 min
- 3Numbers, strings and operatorsDo maths in JavaScript with arithmetic operators and Math, round money correctly, use string methods like trim, includes and slice, and avoid the classic "2" + "3" = "23" trap.35 min
- 4Making decisions with if, else and comparisonsMake JavaScript choose what to do: compare values with === and >, branch with if, else if and else, combine tests with && and ||, and understand truthy and falsy values.35 min
- 5Arrays and loopsKeep lists of values in JavaScript arrays, read and change items by index, add and remove items, and repeat work with for...of, counting for loops and while loops.35 min
- 6JavaScript functions: reusable blocks of codeWrite JavaScript functions with parameters and return values, use default values and arrow functions, understand scope, and split a program into small, testable pieces.35 min
Module 2: Data and the page
Objects and array methods, the DOM, events, forms and rendering lists.
- 7Objects, arrays of objects and array methodsGroup related data in JavaScript objects, work with lists of objects like real app data, and transform them with the array methods map, filter, find, reduce and sort.40 min
- 8The DOM: finding and changing page elementsUse the DOM to find elements with querySelector and querySelectorAll, change their text, classes and attributes, and create, add and remove elements with JavaScript.40 min
- 9Events: responding to clicks and typingMake pages interactive with addEventListener: respond to button clicks, live typing and form submission, use the event object and preventDefault, and keep interactions accessible.40 min
- 10Reading form input and validating itRead text boxes, numbers, drop-downs, checkboxes and radio buttons with JavaScript, convert and check the values, and show clear, accessible error messages before using them.40 min
- 11Showing data: lists, filters and live searchTurn an array of objects into a page with a render function, then add live search, a category filter and sorting, with an empty state and a result count, as real shopping and job sites do.40 min
Module 3: Saving and loading data
localStorage, JSON, timers, promises and fetch.
- 12Saving data with localStorage and JSONMake your pages remember things after a refresh: save and load text with localStorage, store arrays and objects as JSON, handle missing or broken saved data, and know what never to store.35 min
- 13Timers, promises and loading data with fetchUnderstand asynchronous JavaScript: setTimeout, promises and async/await, then load JSON data from the web with fetch, show loading and error states, and handle failures with try/catch.45 min
Module 4: Final project
Build a to-do list app that remembers your tasks.
Final project
To-do list app
An accessible to-do list that adds, completes, deletes and filters tasks, validates input and saves everything in the browser.
You complete the course when every lesson is marked complete and your project passes its self-check rubric.
Prerequisites
- HTML & CSS for Beginners · JavaScript changes HTML and CSS, so you need to know how pages are built.
This course prepares you for
- Python for Beginners · Add a second language used for back ends, automation, data and AI.