• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

14.7. Links

The links[] array of the Document object contains Link objects that represent each of the hypertext links in a document. Recall that HTML hypertext links are coded with the href attribute of the <a> tag. In JavaScript 1.1 and later, the <area> tag in a client-side image map also creates a Link object in the Document links[] array.

The Link object represents the URL of the hypertext link and contains all the properties that the Location object (introduced in Chapter 13) does. For example, the href property of a Link object contains the complete text of the URL to which it is linked, while the hostname property contains only the hostname portion of that URL. See the client-side reference section for a complete list of these URL-related properties.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint