Dom & Dom Manipulation

Please click on this link to access the resource folder for this lesson.

Browser specification

  • Web browsers give a means to control web pages.
  • There’s a “root” object called window. It has two roles: 
    • First, it is a global object for JavaScript code, as described in the chapter Global object.
    • Second, it represents the “browser window” and provides methods to control it.
For instance, here we use it as a global object: alert(window.innerHeight); // inner window height

DOM

  • Document Object Model, or DOM for short, represents all web page content as objects that can be modified.
  • The document object is the main “entry point” to the page. We can change or create anything on the page using it.
  • Properties and methods are described in the specification: DOM Living Standard.
  • An HTML/XML document is represented inside the browser as the DOM tree.

Scroll to Top