Page 117 - DCAP202_Fundamentals of Web Programming
P. 117

Fundamentals of Web Programming                                 Anil Sharma, Lovely Professional University




                    Notes                                  Unit 9: DOM Model


                                     CONTENTS
                                     Objectives
                                     Introduction

                                     9.1   DOM Model – An Overview
                                          9.1.1  Objects of Desire
                                          9.1.2  Dial M for Model

                                          9.1.3  Nodes
                                     9.2  Objects in HTML
                                          9.2.1  Document Object
                                          9.2.2  Event Object
                                          9.2.3  Element Object

                                     9.3  Summary
                                     9.4  Keywords
                                     9.5  Review Questions

                                     9.6   Further Readings
                                   Objectives


                                   After studying this unit, you will be able to:
                                      Understand DOM Model
                                      Discuss Objects in HTML

                                   Introduction

                                   The Document Object Model (DOM) is a programming API for HTML and XML documents. It
                                   defines the logical structure of documents and the way a document is accessed and manipulated.
                                   In the DOM specification, the term “document” is used in the broad sense – increasingly, XML is
                                   being used as a way of representing many different kinds of information that may be stored in
                                   diverse systems, and much of this would traditionally be seen as data rather than as documents.
                                   Nevertheless, XML presents this data as documents, and the DOM may be used to manage this
                                   data.
                                   With the Document Object Model, programmers can create and build documents, navigate their
                                   structure, and add, modify, or delete elements and content. Anything found in an HTML or XML
                                   document can be accessed, changed, deleted, or added using the Document Object Model, with a
                                   few exceptions – in particular, the DOM interfaces for the internal subset and external subset
                                   have not yet been specified.

                                   9.1 DOM Model – An Overview


                                   The Document Object  Model is a programming API for documents. The object model  itself
                                   closely resembles the  structure of the documents it models. For instance, consider this table,



          110                               LOVELY PROFESSIONAL UNIVERSITY
   112   113   114   115   116   117   118   119   120   121   122