01. The Browser Object Model

JavaScript's power and flexibility comes from its ability to access and manipulate objects that are native to the browser environment.

The collection of these objects is known as the Browser Object Model (BOM). The BOM is a tree-like hierarchy of objects, each with useful access properties and methods. Essentially, this object allows you to talk with your user's browser.

Functions include querying the the browser window size, the main heading of the page, a pointer to the last page in a user's history and more!

Elements of the Browser Object Model

The BOM's root is the window object, which displays properties of the current open window or tab. It has several children, most of which we'll cover in this section.

JavaScript BOM tree

Here is a brief description of each element on the tree.

Contains all HTML elements of the current page.
Any frames embedded within the current page.
Contains a stack of sites visited in the current session.
Stores URL of the current page.
Stores information about the browser being used, and the OS used by the browser.
Display properties of the user's computer or device.

Because the document element has much to cover, it deserves its own section; we'll cover the other elements here, starting with the window object.

Build modern and responsive webpages

The Modern Web

Build modern and responsive webpages Try Front-end

The Modern Web will guide you through the most important tools of device-agnostic web development, including HTML5, CSS3, and JavaScript. The plain-english explanations and practical examples emphasize the techniques, principles, and practices that you'll need to easily transcend individual browser quirks and stay relevant as these technologies are updated.

$ Check price
34.9534.95Amazon 4.5 logo(30+ reviews)

More Front-end resources

Aching back from coding all day?

Prism Glasses

Aching back from coding all day? Try Back Problems

Ever feel achy from sitting crunched up on your computer table? Try lying down with these optical glasses that allow you to work on your laptop while lying flat on your back. This is the perfect solution with those with limited mobility or those who wish to prevent neck cramps and back strains.

$ Check price
4.454.45Amazon 4 logo(128+ reviews)

More Back Problems resources