Part 5 · JavaScript in the browser · Learn to program

Knowledge Videos

Short animated explainers, organised by subject.

Learn to program

8 videos

A step-by-step path for complete beginners: how computers and the web work, then HTML, CSS, JavaScript, Go and a full-stack app of your own.

Part 5 · JavaScript in the browser

1:26

24What is Git?

Git remembers every saved version of a folder. Repository, commit, and the four first commands: git status, add, commit and log.

Gitrepositorycommitversion controlbeginner
1:24

25The DOM

The DOM is the tree of nodes the browser builds from your HTML. Find a node with document.querySelector and change it with textContent.

DOMquerySelectortextContentJavaScriptbeginner
1:19

26Events in the browser

An event is something that happens on the page. addEventListener waits for it and runs a handler function, shown next to the same idea in Scratch.

eventaddEventListenerhandlerJavaScriptbeginner
1:18

27Changing the page

Toggle a class with classList so CSS restyles an element, and build new elements with createElement and append, like a to-do list adding tasks.

classListcreateElementappendDOMJavaScriptbeginner
1:15

28Arrays and objects

An array is a numbered list, an object is a set of labelled values. An array of objects and a loop turn data into cards.

arrayobjectpropertyloopJavaScriptbeginner
1:24

29Local storage and JSON

localStorage is the browser's notebook for your site. JSON.stringify turns an array or object into text to save, and JSON.parse turns it back.

localStorageJSONstringifyparseJavaScriptbeginner
1:26

30Fetch and JSON

The browser is the client and fetch sends the request. The server answers with JSON, async and await wait for it, and the Network tab shows what happened.

fetchJSONasyncawaitAPIbeginner
1:16

31Debugging JavaScript

Find bugs in JavaScript: console.log to look, reading an error message and its line, and a breakpoint to pause and step through code in DevTools.

debuggingconsole.logbreakpointerrorDevToolsbeginner