JavaScript Object Arrays

Before you read about the other objects in the Web browser object hierarchy, now is a good time to learn about JavaScript's object array. An object array is used by JavaScript to reference objects when more than one of the objects is in the current window or document (known as multiple instances of the object). An XHTML document is likely to contain more than one hypertext link, for example, so more than one link and anchor object will be present. Each form requires a separate form object, each image an image object, and so on.

JavaScript gives you multiple ways of referencing and accessing these objects. Consider the following excerpt of XHTML code, for example:

<form name="MyForm1" action=… method=…>
   XHTML form elements… ...

Get Platinum Edition Using XHTML™, XML, and Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.