• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 23. Programming Links and Anchors > Working with the Anchor Object

Working with the Anchor Object

The close cousin of the link is the anchor. Whereas you define a link using the <a href> tag, you define an anchor using the <a name> tag. In your JavaScript code, you can work with a page's anchors via the Document object's anchors property, which returns an array that consists of all the anchors defined in the document. Each of those array items is an Anchor object.

Referencing an Anchor Object

To specify an Anchor object, you use an index with the anchors array:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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