You are on page 1of 5

Running head: DOM

DOM DeAnne McKinsey IT 238 February 26, 2011 SUDARSHANA MURTHY

DOM DOM When it comes to creating web pages, most people are aware of Extensible Hypertext Markup Language (XHTML), but in order to create a more dynamic website, one must become aware of Dynamic HTML (DHTML). While XHTML allows web pages to be written and viewed on the internet, many more pages are incorporating images and formatting, to include animations and databases. Normal XHTML forces the web page to be reloaded from the server every time a link is activated, while DHTML does not. According to Gosselin, At the core of DHTML is the Document Object Model, or DOM, which represents the HTML or XML of a Web page that is displayed in a browser. The Document Object Model that represents HTML content is referred to as the HTML DOM and the Document Object Model that represents XML content is referred to as the XML DOM.

Document Object Model (DOM) is one of the most important aspects of Dynamic HTML (DHTML) (Gosselin, 2008). DOM is what updates the types of effects such as, interactive and animated Web pages. The DOM is made up of various techniques and properties that dynamically generate Web pages and manipulate elements (Gosselin, 2008). The most important part of HTML DOM is the Document object. Other objects that signify elements on a Web page can be accessed through the Document object. While W3C specifically prefers XML DOM, it is easier to use HTML DOM. Since the W3C Consortium prefers XML DOM, there are many methods of the Document object that are

DOM

specified in the WC3 DOM. According to Gosselin, some of the document methods as specified in the W3C Dom are: close ( ) method - closes a new document that is created with the open ( ) method, getElementById (ID) method - returns the element represented by ID, getElementsByName (name) method - returns a collection of elements represented by name, getElemtsByTagName (tag name) method - returns a collection of elements represented by tag name, open ( ) method - opens a new document in a window or frame, write (text) method - writes new text to a document, and writeIn (text) method - writes new text to a document followed by a line break

Also according to Gosselin, various properties of the HTML DOM Document object are used for manipulating Web page objects. The properties that are specified in the W3C Dom include: anchors returns an array of the documents anchor elements body returns the documents <body> or <frameset> element cookie returns the current documents cookie string domain returns the domain name of the server where the document is located forms returns an array of the documents forms images returns an array of the documents images, links returns an array of the documents links

DOM Gosselin takes special note of the image object. An Image object represents an image created using the <img> element. You need to use an Image object if you want to dynamically change an image that is displayed on a Web page. Since there are many aspects to the image object, it is important to pay attention and know how and when to use the appropriate tags for this object. By having the ability to use the appropriate tags, a designer can turn an ordinary image into a simple animation. Being a website designer is not a difficult task, being an outstanding designer and developer means knowing the difference between XHTML and DHTML, how to use the

differences and by knowing how to create a dynamic website for a customer allows a designer to showcase their ability, knowing the differences between objects and methods and using them to their fullest potential can go a long way in making a customer happy and allow a designer to showcase their work easily and effortlessly.

DOM Reference Gosselin, D. (2008). JavaScript (4th ed.). Boston, MA: Thomson Course Technology.

You might also like