DOCUMENT OBJECT MODEL
DOCUMENT OBJECT MODEL
• The Document Object Model (DOM) is a cross-
platform and language-independent convention for
representing and interacting with objects in HTML,
XHTML and XML documents.
• Aspects of the DOM (such as its "Elements") may
be addressed and manipulated within the syntax of
the programming language in use.
• The public interface of a DOM is specified in its
application programming interface (API).
• Document Object Model, the specification for how
objects in a Web page (text, images, headers, links,
etc.) are represented.
• The DOM defines what attributes are associated
with each object, and how the objects and
attributes can be manipulated.
• Dynamic HTML (DHTML) relies on the DOM to
dynamically change the appearance of Web pages
after they have been downloaded to a user's
browser.
• The two leading browsers -- Netscape Navigator and
Microsoft Internet Explorer -- use different DOMs.
• This is one reason why their respective
implementations of DHTML are so different.
• Both companies have submitted their DOMs to the
World Wide Web Consortium (W3C) for
standardization, which now has the daunting task of
specifying a standard DOM without alienating either
of the browser giants.
• The W3C's DOM specification will support both
HTML and XML.
• The Document Object Model offers three levels of
interface implementation:
– Core DOM - standard model for all document types
– XML DOM - standard model for XML documents
– HTML DOM - standard model for HTML documents.
• Here are some highlights:
– Any HTML or XML element (with the possibility of a few
exceptions) will be individually addressable by
programming.
– The specification will be language-independent.
– In addition, the interface will be described in terms of
the programming language .
• The HTML DOM is a standard object model
and programming interface for HTML. It defines:
– The HTML elements as objects
– The properties of all HTML elements
– The methods to access all HTML elements
– The events for all HTML elements
• The HTML DOM is a standard for how to get,
change, add, or delete HTML elements.
Collection Description W3C
anchors[] Returns an array of all the anchors in the document Yes
forms[] Returns an array of all the forms in the document Yes
images[] Returns an array of all the images in the document Yes
links[] Returns an array of all the links in the document Yes