BOM stands for Browser Object Model while DOM stands for Document Object Model.
BOM
The BOM refers to the set of JavaScript objects browsers provide you with. It gives you the window object in JavaScript. If you open up your inspector and write console.log(window), youโll see the list of every JavaScript method you can use.
As you can see, thereโs a lot we can do with JavaScript.
Donโt worry about remembering everything โ weโll cover the most important ones you need to know as you proceed through the course. So for now, letโs move on with this lesson.
You can use any property within the window object by typing window.propertyName or simply just propertyName. So, the following two are equivalent:
window.documentdocumentDOM
The DOM refers to your HTML in JavaScript. Open up your inspector, click on the โElementsโ tab and youโll see the DOM.
You can access it with document.
Youโll use the DOM when you build things โ which is coming up in the next chapter!
Exercise
Try to get the DOM with document. Log it out with your console. Click on the arrows in the results of that log to explore your DOM.
Welcome! Unfortunately, you donโt have access to this lesson. To get access, please purchase the course or enroll in Magical Dev School.
Unlock this lesson