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