DOM(Document Object Model)
The DOM is the Document Object Model, which deals with the document, the HTML elements themselves, It organize the elements of the document in tree structure (DOM tree) and in the DOM tree, all elements of the document are defined as objects (tree nodes) which have properties and methods.When a web page is loaded, the browser creates a DOM tree for all the objects (Html elements) of that page.
e.g. document and all traversal you would do in it, events, etc.
e.g. document and all traversal you would do in it, events, etc.
A Simple DOM Tree |
BOM(Browser Object Model)
The BOM is the Browser Object Model, which deals with browser components aside from the document,like history, location, navigator and screen (as well as some others that vary by browser).
The Browser Object Model (BOM) in JavaScript includes the properties and methods for JavaScript to interact with the web browser. BOM provides you with window object, for example, to show the width and height of the window. It also includes the window.screen object to show the width and height of the screen.
The Browser Object Model (BOM) in JavaScript includes the properties and methods for JavaScript to interact with the web browser. BOM provides you with window object, for example, to show the width and height of the window. It also includes the window.screen object to show the width and height of the screen.
Each HTML page which is loaded into a browser window becomes a Document object and document object is an object in the BOM.
The important BOM objects are as:
- document
- location
- history
- navigator
- screen
- frames
Comments
Post a Comment