Question 43Asked in DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)

Which of the following statements about the DOM (Document Object Model) in JavaScript is

Which of the following statements about the DOM (Document Object Model) in JavaScript is true regarding its interaction with HTML and JavaScript?
  1. AThe DOM only allows reading the HTML document but does not permit any changes or updates.
  2. BThe DOM allows JavaScript to directly modify the structure of the HTML document by manipulating its elements, attributes and content.
  3. CThe DOM is a static representation of the page and does not update dynamically when changes occur in the document.
  4. DThe DOM can only interact with text-based HTML documents and cannot modify styles or events.
Show answerHide answer

Correct answer: (B) The DOM allows JavaScript to directly modify the structure of the HTML document by manipulating its elements, attributes and content.

Explanation

The DOM is a live tree of the page. JavaScript can use it to add, remove or change elements, attributes, content, styles and events, and the page updates immediately.

From DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 3 (5:00 PM)

This is question 43 of DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 3 (5:00 PM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.