Aicloud E-Learning

Guided Notes

Introduction to JavaScript

Variables, the DOM, and responding to events.

JavaScript adds behavior to a page: what happens when you click, type, or scroll. It runs directly in the browser — nothing to install.

`document.querySelector(...)` finds an element in the page so you can read or change it. `element.textContent = "..."` updates what's on screen; `element.addEventListener("click", fn)` runs `fn` whenever that element is clicked.

A variable (`let count = 0`) holds a value that can change. Functions bundle reusable logic; the code inside an event listener is just a function that runs later, when the event fires.