What is the DOM and BOM in JavaScript?

后端 未结 8 1039
太阳男子
太阳男子 2021-01-29 18:39

What is the DOM and BOM in JavaScript? If someone could explain these in layman terms it would be great! I like to get a deeper understanding of these.

8条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-29 19:08

    They're just different objects you're dealing with:

    • The DOM is the Document Object Model, which deals with the document, the HTML elements themselves, e.g. document and all traversal you would do in it, events, etc.
    • The BOM is the Browser Object Model, which deals with browser components aside from the document, like history, location, navigator and screen (as well as some others that vary by browser).

提交回复
热议问题