OE1-5.2 JavaScript & the Document Object Model
You can write JavaScript with its primitive operations, expressions, arrays, functions and regular expressions, access elements through the DOM, handle events from body, button, text box and password elements, and position and move elements dynamically.
The DOM is the idea that turns a static page into a program's data structure — the browser parses your HTML into a tree, and JavaScript edits the tree. Event handling is where the mental model shifts from top-to-bottom execution to responding to things that happen, and that shift is the real content of this unit. Regular expressions are worth the effort they cost: they are the standard tool for validation and appear in every language you will meet afterwards.
Work through these
JavaScript primitive operations and expressions
The language basics, moving quickly because they are shared with everything you know. The type coercion rules are the part that is genuinely different and worth care.
Arrays and functions
Grouping data and grouping code. Functions as values is the feature that most distinguishes this language from the ones you have used.
Pattern matching using regular expressions
Matching patterns in text, which is a tool far beyond this course. Powerful, and quick to become unreadable, so write them with comments.
The Document Object Model
The page as a tree of objects your code can change. It is the bridge between the markup topic and anything interactive.
Element access in JavaScript
Finding the part of the page you want to change. Selecting badly is why so much page code is fragile.
Events and event handling
Responding to what the user does, which is the whole point of scripting a page. The model of registering a handler is the concept to get right.
Handling events from body, button, text box and password elements
The specific cases you will meet first, including form controls. Handling password fields raises questions the course should not gloss over.
Positioning and moving elements; float and clear
Moving things around after the page has loaded, and the older layout mechanisms. Included for completeness; the grid from the previous topic is the modern answer.
Sign in to keep your progress.
Free resources
We haven't checked most of these for screen reader use yet.
Links last checked 30 Aug 2026.
Stuck here?
Ask a mentor. A real person answers, and they can see exactly which topic you're on. Usually within a couple of working days.
Checking your session…
Topics shown in module order.