HTML and CSS Reference
a popup window, calling a function from a link, submitting a form from a link, and so
on. This chapter focuses on how links are used with images.
As you know, HTML hypertext links are usually created by assigning a Web address
or a file name to the HTML <a href> tag, for example:
<a href="http://www.ellieq.com">Go Home</a>
the function will be executed (see Example 12.4).
And you can use an event handler with a link (see Chapter 13):
<a href="newpage.htm" onClick="newwindow();return false" >Click Here!</A>
Like the form object and image object, the link object is a property of the document
object and gives you access to the hypertext links that have been loaded into a document
(see Figure 12.3). It corresponds to the HTML <a href> tag. As each HTML form is a Java-
Script element of the forms array, and each image is assigned to the images array, so
each link is assigned to the links array in the order in which the link appears within
Figure 12.3 Document object and links.
The first link would be represented as document.links . The properties for the links
object are shown in Tables 12.3 and 12.4. 3 There are no common methods for the links
3. These properties are common to both Netscape and Internet Explorer. Internet Explorer, however, sup-
ports many more than are listed here.