L
LLLOS.ai
Learn
L

Ask Your Tutor · Computer Science

What is a BOM and how does it work?

From NCERT In depth Asked by Anonymous from Dallas, United States 23 Oct 2026, 11:16 PM IST Updated

In one line

The BOM (Browser Object Model) lets you control the browser itself using JavaScript, not just the web page.

The rule

The Browser Object Model (BOM) is a set of objects provided by web browsers that allow scripts to interact with the browser window and control things like navigation, pop-ups, and browser information.

There is no single formula, but the main BOM objects are: window, navigator, screen, location, and history.

Let's understand it simply

Imagine you are watching a cricket match on TV. The TV remote lets you change the channel, adjust the volume, or see what channel you are on. The BOM is like that remote for your browser. It lets JavaScript do things like open a new tab, go back to the previous page, or find out what browser you are using.

The DOM (Document Object Model) is about changing the content inside the web page (like changing the score on the screen). The BOM is about controlling the browser itself (like changing the channel or adjusting the volume).

DOM vs BOM
DOMBOM
What it controlsWeb page content (HTML, CSS)Browser window, navigation
Main objectdocumentwindow
ExampleChange text on pageOpen new tab
Standard?Yes (W3C)No (browser-specific)

How it works

  1. Browser provides BOM objects: When you open a web page, the browser gives JavaScript access to special objects.
  2. Main object is window: Everything in the BOM starts from the window object. It represents the browser window.
  3. Other objects are inside window: Objects like navigator, location, history, and screen are all part of window.
  4. JavaScript uses these objects: You can write code to use these objects. For example, window.open() opens a new tab or window.
  5. Browser responds: The browser does what the code says—like going to a new website or showing a pop-up.
How BOM Works
  1. Browser loads web page
  2. Browser gives JavaScript access to BOM objects
  3. JavaScript uses BOM objects like window, location, history
  4. Browser responds to commands (open tab, show alert, etc.)

The story behind it

When the first web browsers were made in the 1990s, web pages were simple and could not interact much with the browser. As the web grew, people wanted web pages to do more—like open new windows, check what browser you are using, or move to another website. So, browser makers added the BOM. Unlike the DOM, which is a standard, the BOM was not the same in every browser at first. Over time, browsers started to agree on how BOM should work, but some differences still exist.

Where you see it in real life

  • window.open('https://www.cbse.gov.in') → Opens a new tab to the CBSE website → Uses BOM to control the browser window.
  • window.alert('Exam tomorrow!') → Shows a pop-up message → BOM lets JavaScript display alerts.
  • location.href = 'https://www.google.com' → Takes you to Google → BOM changes the current website.
  • history.back() → Goes back to the previous page → BOM controls browser history.
  • navigator.userAgent → Checks which browser you are using (like Chrome or Firefox) → BOM gives browser info.
  • screen.width → Finds out the width of your screen → BOM helps make websites look good on your device.

Why it matters

  • Web apps: Many online tools (like online forms or games) use BOM to give you pop-ups or move you between pages.
  • Browser detection: Some websites check your browser to work better or show warnings.
  • Navigation: BOM lets you go back, forward, or reload pages with code.
  • Responsive design: BOM helps websites adjust to your phone, tablet, or computer screen.
  • Exams and projects: Knowing BOM is needed for CBSE Computer Science projects and questions.

Worked example

Let’s say you want to show a pop-up when a user visits your site:

Step 1: Write the code           window.alert('Welcome to our site!');
Step 2: What it does             Shows a pop-up box with the message.
Step 3: Why it works             'alert' is a BOM method that tells the browser to show a message.

Another example: Redirect to another page.

Step 1: Write the code           location.href = 'https://www.cbse.gov.in';
Step 2: What it does             Takes the user to the CBSE website.
Step 3: Why it works             'location' is a BOM object that controls the current page URL.

Common mistakes

  • Mixing up DOM and BOM: DOM changes the web page content; BOM controls the browser.
  • Thinking BOM is the same everywhere: Some BOM features work differently in different browsers.
  • Forgetting security: Some BOM methods (like window.open) may be blocked by the browser for safety.
  • Not using window: All BOM objects are part of window, but you can often skip writing window. because it is the default.

Remember it

BOM is like the remote control for your browser—use it to open, close, move, or get info about the browser itself.

Check yourself

What does BOM stand for?

Browser Object Model—it lets scripts control the browser itself.

How is BOM different from DOM?

BOM controls the browser window and navigation; DOM changes the web page content.

Why might window.open() not work in some browsers?

Browsers may block pop-ups for security reasons.

Give an example of a BOM object and what it does.

location—lets you change or get the current page URL.

Quick recap

  • BOM stands for Browser Object Model.
  • BOM lets JavaScript control the browser window and navigation.
  • Main BOM objects: window, navigator, location, history, screen.
  • BOM is different from DOM, which changes web page content.
  • BOM is not a strict standard—some features vary by browser.
Written by the LLOS.ai tutor, checked against NCERT chapters. Asked by Anonymous from Dallas, United States on 23 Oct 2026, 11:16 PM IST