Why not try it?
<body onload="alert(document.links['test'].href);">
<a href="test.html" id="test">A Link</a>
The above works in Mozilla 1.5a, not IE
<body onload="alert(document.links('test').href);">
<a href="test.html" id="test">A Link</a>
The above works in IE, not Mozilla 1.5a
<body onload="alert(document.getElementById('test').href);">
<a href="test.html" id="test">A Link</a>
The above works in IE 6SP1, Mozilla 1.5a and Opera 7.11. I didn't check
the first two test in Opera because each failed in at least one of the
two major browsers you probably want to support. Also, simply because I
provided specific browser versions does not mean it won't work in early
versions, it simply means those are the versions I tested the code with.
--
| Grant Wagner <
[email protected]>
* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/fr
ames.html
* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_en
try.asp
* Netscape 6/7 DOM Reference available at:
*
http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 6/7 and Mozilla
*
http://www.mozilla.org/docs/web-developer/upgrade_2.html