
The video is part of the full course
In this lesson you will
- Declare variables with const
- Write and call functions that return values
- Find elements with querySelector and change them
- Respond to clicks with addEventListener
HTML is the structure and CSS is the look; JavaScript is the behaviour. It runs in the browser and can read and change the page after it has loaded. In this lesson you'll add two features to the bakery site: a badge that says whether the shop is open right now, and questions that expand when clicked.
Load the script
Create script.js and load it just before </body>. Placing it at the end means the HTML above it already exists when the script runs.
<script src="script.js"></script>
</body>Continue with the full course
The rest of this lesson, the narrated video, the PDF and the exercise are part of Web Development Foundations. One payment, lifetime access.
Already bought it? Sign in with the email you paid with.
