Home » Internet » Web Design

Introduction to HTML DOM

Aug 26, 2007
Web sites used to be created exclusively with HTML. Formerly, a web site consisted of nothing more than some text and a few HTML tags to provide the structure and formatting for the web page, accompanied by some graphics to provide style.

Web design has changed mightily since its earliest days. Nowadays, the projects given to web designers by ecommerce companies require more advanced programming languages and specifications in order to produce the virtual masterpieces that we see when we surf the net. So, many new languages and specifications have been created to provide a more effective way to structure and design web pages. One such programming innovation is HTML DOM.

HTML DOM is the Document Object Model for HTML. This model is now compatible with most web browsers. It provides a standard set of objects that can be used in HTML programming, making it easier to access and change web documents. The Document Object model looks at documents as a tree. Each of the elements within the HTML Document ais regarded as a branch on a tree, and these elements can be accessed and modified through the DOM.

Also, this language is platform and language independent. The cross-platform compatibility is extremely significant because most wireless devices are now equipped with access to the internet and email. These wireless gadgets have installed on them web browsers and platforms that are not compatible with many elements of the HTML programming language. The Document Object Model enables programmers to create HTML documents that are structured in such a way that all web browsers will be able to display the document relatively equally, regardless of what sort of device is being used to view the web page. Also, it is compatible with all programming languages, including Javascript and VBScript.

The document object is the parent object of all other objects within the document. The document object gives birth, if you will, to the body object and all of the attributes and elements of the document. Here is an example of Document Object Model code that would be used to define the background color of an HTML document:


In this example, document is the parent object, body is the child, and bgcolor is an attribute of the body object. HTML document objects can also respond to functions created with languages such as Javascript.

There is a huge set of predefined objects used by this language. To view the entire list of available objects and their properties, I recommend that you study some simple online tutorials available on sites such as the W3C (World Wide Web Consortium). If you are already well versed in web design, learning HTML DOM is fairly easy because the syntax is not complicated. If you design web sites for a living, you need to familiarize yourself with this language. With so many different web browsers and platforms on the market, some of which are incompatible with HTML, not using DOM could mean that the web sites you create will appear scrambled or might even be invisible to the user.
About the Author
Jim Pretin is the owner of http://www.forms4free.com, a service that helps programmers make email forms.
Please Rate:
(Average: Not rated)
Views: 182
Print Email Report Share
Article Categories