Web Development · Beginner level

Beginner level · Module 3 of 5 · 10 guided hours

JavaScript for Web Pages

Learn enough JavaScript to make web pages interactive: variables, functions, the DOM, events and form handling.

Learning objectives

  • Write basic JavaScript with variables, conditions, loops and functions
  • Select and update page elements
  • Handle clicks and form submissions

Topics

  • script loading with defer
  • variables, conditions and functions
  • arrays and objects
  • querySelector and textContent
  • event listeners
  • form validation messages

Lessons

  1. Lesson 1 JavaScript Essentials for the Web

    Write the core JavaScript a web developer needs: variables, conditions, loops, functions, arrays and objects.

    const and letif/else and ===functionsarrays of objects

  2. Lesson 2 Changing the Page with the DOM

    Select elements, change their content and classes, and generate lists from data.

    querySelectortextContentclassListcreateElement and append

  3. Lesson 3 Events and Form Handling

    Respond to clicks and form submissions, validate input and show friendly messages without reloading the page.

    addEventListenersubmit and preventDefaultvalidation messagesaria-live

Practical activity

Add a filterable list of services (by category) and an enquiry form with friendly validation messages to the organisation site.

Expected outcomes

  • Interactive features built with plain JavaScript
  • Forms that guide users to correct input

Assessment

Practical: add one interactive feature to a provided page; marked on behaviour, accessibility and absence of console errors.

Free taster lesson JavaScript Essentials for the Web Read a free self-study lesson on this topic in the Free Course Library.

Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.