0% found this document useful (0 votes)
5 views2 pages

DOM (Document Object Model)

The Document Object Model (DOM) is a programming interface that represents web documents as a tree of objects, allowing dynamic manipulation of HTML or XML content. Key features include a tree structure for document organization, the ability to change content and styles using JavaScript, and event handling for user interactions. An example is provided, demonstrating how to change text in a paragraph using a button click.

Uploaded by

sheikhshahib123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

DOM (Document Object Model)

The Document Object Model (DOM) is a programming interface that represents web documents as a tree of objects, allowing dynamic manipulation of HTML or XML content. Key features include a tree structure for document organization, the ability to change content and styles using JavaScript, and event handling for user interactions. An example is provided, demonstrating how to change text in a paragraph using a button click.

Uploaded by

sheikhshahib123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

DOM

The DOM (Document Object Model) is a programming interface for web


documents. It represents the structure of an HTML or XML document as a tree of
objects. These objects correspond to elements, attributes, and text in the document,
allowing developers to manipulate and interact with the content dynamically.

Key Features of the DOM

1. Tree Structure: The DOM represents the document as a tree of nodes (e.g.,
<html> is the root node, and its children are <head> and <body>).

2. Dynamic Interaction: You can change the document's structure, style, and
content using JavaScript.

3. Event Handling: The DOM allows you to handle user interactions like
clicks, inputs, and other events.

<!DOCTYPE html>

<html>

<body>

<p id="demo">Original Text</p>

<button onclick="changeText()">Click Me</button>

<script>

function changeText() {
var paragraph = document.getElementById("demo");

paragraph.innerHTML = "Text Changed!";

</script>

</body>

</html>

You might also like