Complete each lesson, attempt the exercise and compare with the worked answer.
Web foundations: HTML, CSS and JavaScript
Build a small accessible page and make it interactive.
Open coding playground Developer toolsSemantic HTML
Use a main element for the primary content, a heading for the topic, a label for every form control and a button for an action. Structure matters before styling. A link navigates; a button performs an action. The accessible name of an input can come from its associated label.
Practice
Create a form with a label associated with a text input and a submit button.
Review answer
<label for="name">Name</label><input id="name" name="name"><button type="submit">Send</button>
Responsive CSS
Use flexible containers, relative widths and media queries. A responsive grid can use repeat(auto-fit,minmax(180px,1fr)) with a gap. Check narrow screens and ensure labels and buttons do not overflow.
Practice
Build a three-card grid that wraps on narrow screens.
Review answer
display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:16px;
DOM events
Use addEventListener to attach event handlers. Prefer textContent to insert text safely instead of innerHTML. Keep state and display separate so you can update the interface predictably.
Practice
Add a button that increments a counter.
Review answer
let n=0; button.addEventListener("click",()=>{ count.textContent=++n; });
