Simple to understand DOM and BOM


DOM wrote in a previous blog post , to write about today BOM and DOM

First, the basic concept

What is

  • DOM: Document Object Model
  • BOM: Browser Object Model

Both sum up in one sentence

  • DOM: The html document (ie web page) completely converted to objects
  • BOM: The various components of the browser completely converted to objects

Model shows the relationship between the object and the object, then the object Once you have it, is the operating object.

Second, with the DOM illustrates BOM

On the BOM and DOM browser
Here Insert Picture Description
ABCD area are BOM, DOM for the E zone, and zone A tab is a document, that document
document is the root node in the DOM, the document object so that the object is both a DOM object BOM

DOM model diagram
Here Insert Picture Description
Each element can be used as an object

BOM object graph
Here Insert Picture Description
The inside of the window belongs to the double role, both BOM object is the global object browser, and other objects are properties window

Third, the summary

All things in JS through the DOM and BOM into an object, using a programming object properties and methods

Published 202 original articles · won praise 96 · views 90000 +

Guess you like

Origin blog.csdn.net/shang_0122/article/details/104922890