Document Object Model(DOM)

DOM

The DOM (Document Object Model) is a programming interface that represents a webpage as a structured tree of objects.

When a browser loads an HTML or XML document, it converts the page into a DOM tree. Each element, attribute, and text block becomes a node that scripts can read, modify, add, or remove.

The DOM allows JavaScript and other tools to interact dynamically with webpage content.

Also known as: Document Object Model, DOM tree, HTML DOM.

How Does the DOM Work?

The browser parses a webpage and builds a hierarchical structure based on the document's elements.

For example, a simple page may contain:

<html>
  <body>
    <h1>Hello</h1>
    <p>Welcome to the page.</p>
  </body>
</html>
Join SwiftProxy Discord community Chat with SwiftProxy support via WhatsApp Chat with SwiftProxy support via Telegram
Chat with SwiftProxy support via Email