Document Object Model (DOM)

The Document Object Model gives you scripting access to all the elements on a web page. Using JavaScript, you can create, modify and remove elements in the page dynamically.The most common way to access an HTML element is to use the id of the element. Here's an example:

JavaScript:
tutorial

HTML:
tutorial

This example changes the text on the page from 'Click the button' to 'Hello World!'. JavaScript access that element using getElementById function and using the id specified for that element in HTML. The innerHTML property is used to modify the text of HTML element.

START OVER