Web developmentLesson 1 of 1 in the course HTML and CSS

DOM Nodes, Standards History, and JavaScript Manipulation

5 flashcards · 5 quiz questions · 5 match pairs · 5 fill-in sentences · English

Lesson progress
0 / 5

Your progress is kept in this browser only.Sign up to save it

Summary

The Document Object Model (DOM) is the structured representation that lets programs inspect and change HTML and XML documents. This lesson introduces the DOM’s purpose and the relationships between document nodes.

The Document Object Model, or DOM, is a cross-platform, language-independent API for working with documents. It represents an HTML or XML document as a logical structure made of objects called nodes. Programs can use DOM methods and properties to access a document and change its structure, content, or style.

All flashcards

What is the Document Object Model?
The DOM is a cross-platform, language-independent API that represents an HTML or XML document as a logical structure of nodes that programs can access and modify.
What is a DOM node?
A node is an object representing a part of a document, such as the document itself, an element, an attribute, text, or a comment.
What is the root node in a DOM tree?
The document node is the root of the DOM tree. It has no parent and contains the document’s other nodes in a hierarchy.
How are parent and child nodes related?
A parent node contains or organizes one or more child nodes. Every node except the root document node has a parent, and a parent can have multiple children.
What does an event listener do?
An event listener is associated with a node and runs its handler when a specified event, such as a click, occurs.

Quiz questions

  1. Which node type represents text placed inside an HTML element?Answer: A text node.
  2. In what year did DOM Level 1 become a W3C Recommendation?Answer: 1998.
  3. Which capabilities were added in DOM Level 2?Answer: An event model, getElementById, and CSS and XML namespace support.
  4. What does the JavaScript DOM method appendChild do?Answer: Adds a node as a child of another node.
  5. What must happen for a newly created DOM node to appear on a displayed page?Answer: It must be connected to the document, such as by appending it to a displayed container.

Based on the Wikipedia article Document Object Model, licensed CC BY-SA 4.0. Adapted into a summary, flashcards and quizzes.

All Web development lessons