Sunday, September 22, 2019

What is Browser Object Model in JavaScript? Explain with example.

The Browser Object Model (BOM) is used to interact with the browser.

The default object of browser is window means you can call all the functions of window by specifying window or directly. 

For example:

  1. window.alert("Hello JavaScriptCodeGuruJi");  
is same as:

  1. alert("Hello JavaScriptCodeGuruJi");  
You can use a lot of properties (other objects) defined underneath the window object like document, history, screen, navigator, location, innerHeight, innerWidth,

Note: The document object represents an html document. It forms DOM (Document Object Model).

javascript object model
Visit the next page to learn about window object fully with example.

No comments:

Post a Comment