Page 175 - DCAP408_WEB_PROGRAMMING
P. 175

Mandeep Kaur,  Lovely Professional University                                        Unit 6: DOM Model





                                   Unit 6: DOM Model                                            Notes


            CONTENTS
            Objectives
            Introduction

            6.1  DOM Model
                 6.1.1  The JavaScript Assisted Style Sheets DOM (JSSS DOM)
            6.2  Events Handling through JavaScript

                 6.2.1  Event Association
            6.3  How to use Forms in JavaScript
                 6.3.1  Form Validation with JavaScript
            6.4  Summary
            6.5  Keywords

            6.6  Review Questions
            6.7  Further Readings

          Objectives

          After studying this unit, you will be able to:

              Recognize the DOM model
              Describe event handling through JavaScript
              Demonstrate how to use forms in JavaScript

          Introduction

          An HTML page is rendered (painted) in a browser. The browser assembles all the  elements
          (objects) contained in the HTML page, downloaded from the web server, in its memory. Once,
          done the browser then renders these objects in the browser window. Once, the HTML page is
          rendered in the browser window, the browser can no longer recognize individual HTML elements
          (objects).

          To create  an interactive web page, it is imperative that the browser  continues to recognize
          individual HTML objects even after they are rendered in the browser window. This allows the
          browser to access the properties of these objects using the built-in methods of the object. Once
          the properties of an object are accessible then the functionality of the object can be controlled at
          will.

          6.1 DOM Model

          JavaScript enabled browsers are capable of recognizing individual objects in an HTML page,
          after the page has  been  rendered in the browser,  because the  JavaScript enabled  browser
          recognizes and uses the Document Object Model (DOM).






                                           LOVELY PROFESSIONAL UNIVERSITY                                   169
   170   171   172   173   174   175   176   177   178   179   180