What is the DOM and BOM in JavaScript?

后端 未结 8 906
太阳男子
太阳男子 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

    DOM -> Document Object Model in JavaScript is the API to access the elements inside the document. It maps the entire Document into an hierarchy of parent and child tree. Each node can hold number of children element or can inherit to other parent element in some or the other way.

    BOM -> Browser Object Model is a larger representation of everything provided by the browser including the current document, location, history, frames, and any other functionality the browser may expose to JavaScript. The Browser Object Model is not standardized and can change based on different browsers.

    0 讨论(0)
  • 2021-01-29 19:10

    DOM : The document object represents the whole html document. When html document is loaded in the browser, it becomes a document object.

    BOM : The window object represents a window in browser. An object of window is created automatically by the browser.

    0 讨论(0)
提交回复
热议问题