BOM stands for Browser Object Model while DOM stands for Document Object Model.
BOM
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. We’ll cover the most important ones you need to know as you proceed through the course. 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.document
document
DOM
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 a lot in the next few lessons to come.
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.