DOM (Document Object Model)
DOM (Document Object Model)
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>
<script>
function changeText() {
var paragraph = document.getElementById("demo");
</script>
</body>
</html>