Sign In/My Account | View Cart  

advertisement

AddThis Social Bookmark Button

Article:
  Make Internal Links Scroll Smoothly with JavaScript
Subject:   Anchor object
Date:   2005-09-14 12:45:22
From:   Halans
Couldn't you use the document's anchors object to walk through to find the anchor name linked to (which would be shorter than all the 'a' tags on the page), or is there a reason you didn't use it?
Just a thought...
Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • Anchor object
    2005-09-15 02:04:10  aquarius [View]

    The reason I didn't use document.anchors is that it's a DOM0 thing; I try and avoid DOM0 things because they don't always exist, depending on how strict the browser is and so on. It might turn out that I'm wrong about document.anchors specifically, but document.getElementsByTagName will always work and that's the only function I need to learn, rather than document.links and document.forms and all the other DOM0 things.