Let's interact with the DOM

By interacting with the DOM, i.e. by call methods provide by the DOM API, we can change a webpage.

By interacting with the DOM we can also open new windows the DOM API, we can change a webpage.

You can write any program in JavaScript and let it execute in the browser, for example a computer game:

Interactive JavaScript programming using the web console

The web console of the browser provides a convenient way to explore the DOM on a command line. In Firefox, you can open the console with CTRL-SHIFT-K or under Tools -> Web Developer -> Web Console. In the console you can enter pieces of JavaScript code and let these be executed (aka evaluated) by the JavaScript engine inside the browser.

To try it out, open the web console and type the following commands: