Week 9 — Document Object Model (DOM)

Principle of reciprocity
Whatever a person can do with HTML and CSS in creating the contents of a web page, JavaScript can do. And whatever JavaScript can do in creating a web page, a person can do.

The Document Object Model gives the structure within which it is possible to control all aspects of a web page using JavaScript. It enables the implementation of the following principle.

Of course, using JavaScript has the advantage that a program can do things much faster than a person, which means pages can change in real-time.

DOM topics

Class exercise

The JavaScript for adding and removing from a todo list.