Machine-translated by Google. Questions are authored in English.
Top

Discussion

What is the main function of the DOM (Document Object Model) ?

  • A.To define the structure of the HTML document
  • B.To represent the page so that JavaScript can manipulate it
  • C.To load the webpage
  • D.To style the elements of the webpage

Answer: B

The DOM's main function is to represent the page so that JavaScript can manipulate it.

The Document Object Model represents an HTML document as a tree of objects (nodes) that scripts can read and change: adding elements, changing text and styles, and responding to events, all without reloading the page.

The structure is written in HTML, styling is done by CSS, and the browser loads the page; the DOM is the programming interface to the loaded page.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.