Question discussion

Which of the following statements about the DOM (Document Object Model) in JavaScript is true regarding its interaction with HTML and JavaS…

359047Medium DSSSB TGT Computer Science 0 replies 0 views
0
Which of the following statements about the DOM (Document Object Model) in JavaScript is true regarding its interaction with HTML and JavaScript?
  • AThe DOM only allows reading the HTML document but does not permit any changes or updates.
  • BThe DOM allows JavaScript to directly modify the structure of the HTML document by manipulating its elements, attributes and content.
  • CThe DOM is a static representation of the page and does not update dynamically when changes occur in the document.
  • DThe DOM can only interact with text-based HTML documents and cannot modify styles or events.
Correct answer: B

Explanation

The DOM is a live tree representation of the document, and JavaScript can change elements, attributes, content and styles through it.

Discussion 0

Nobody has replied yet. Start the discussion!