Introducing The Javascript Object Model
All you need to know to get started
Photo by Ferenc Almasi on Unsplash
Table of contents
No headings in the article.
When you write scripts, you need to make use of JavaScript objects to manipulate the components of a web page. For example, to validate whether the user has entered a value in the text field in a form, you need to reference the particular text field and check it's value. The text field is treated as an object in JAVASCRIPT. These are the hierarchy of JavaScript objects.
- Navigator
- Window
- Array
- Date
- Math
- String
On the window object we have the . Document . Frames . Location . History
On the document object we have the . Anchor . Image . Form . Link
On the form object we have the . Button . Radio . Reset . Text . Password . Checkbox . Select . Submit . Textarea . Hidden
The hierarchy show in the preceding text shows the principle of containership. For example, the button and check box items contained within the form object. The form object, in turn, is contained within the document object which is contained within the top-level window object.