Mozilla.com

  1. MDC
  2. Main Page
  3. DOM
  4. document.anchors
Table of contents
  1. 1. Summary
  2. 2. Syntax
  3. 3. Example
  4. 4. Notes
  5. 5. Specification
Table of contents
  1. 1. Summary
  2. 2. Syntax
  3. 3. Example
  4. 4. Notes
  5. 5. Specification

« Gecko DOM Reference

Summary

anchors returns a list of all of the anchors in the document.

Syntax

nodeList = document.anchors 

Example

if ( document.anchors.length >= 5 ) {
    dump("dump found too many anchors");
    window.location = "http://www.google.com";
}

Notes

For reasons of backwards compatibility, the returned set of anchors only contains those anchors created with the name attribute, not those created with the id attribute.

Page last modified 16:42, 2 Jul 2007 by DR

Files (0)