Link and Anchor, what is the difference ???

What is the difference between a link and an anchor in Javascript (DOM level
0) ?

Ton


--
Computer museum tonh: http://www.tonh.net/museum - 10.000 visitors !!
GGGallery website generator: http://www.tonh.net/gggallery
Vrij Kunst Centrum : http://www.meesterschap.nu



0
Ton
1/12/2004 2:47:35 PM
comp.lang.javascript 38243 articles. 0 followers. javascript4 (1315) is leader. Post Follow

3 Replies
1170 Views

Similar Articles

[PageSpeed] 1

Ton den Hartog said:
>
>
>What is the difference between a link and an anchor in Javascript (DOM level
>0) ?

A Link has an HREF attribute.  An Anchor does not.

0
Lee
1/12/2004 3:02:58 PM
> >What is the difference between a link and an anchor in Javascript (DOM
level
> >0) ?

> A Link has an HREF attribute.  An Anchor does not.

<a href="http://www.mysite.com">My Site</a>

No ? :-)

Maybe the question is, what IS a link and an anchor..... ?

Ton


0
Ton
1/12/2004 9:00:57 PM
On Mon, 12 Jan 2004 22:00:57 +0100, Ton den Hartog 
<ton.den.hartog.removespam@tonh.net> wrote:

> Maybe the question is, what IS a link and an anchor..... ?

Typically:

   A link is used to take the user to a new location, or to perform an 
action (if scripting is used).

   An anchor is a destination that can be targeted by a link.

The former is acheived with the A element. The latter can also be done 
with the A element and its name attribute, or by specifying a value for 
the id attribute in other elements. To target an anchor, use a fragment 
identifier (#frag-id) in the URI:

<A href="#Section-1">Section 1</A>
<A href="#Section-2">Section 2</A>
  ...
<H1><A name="Section-1">Section 1</A></H1>
  ...
<H1 id="Section-2">Section 2</H1>

For more information, see:

   Links -

       http://www.w3.org/TR/html4/struct/links.html

   Fragment Identifiers -

       http://www.w3.org/TR/html4/intro/intro.html#fragment-uri


Both are taken from the W3C's HTML 4.01 Specification. There are too many 
bits within the 'Links' section to reference individually, so just read it 
all. :)

Hope that helps somewhat,
Mike

-- 
Michael Winter
M.Winter@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
0
Michael
1/12/2004 10:10:23 PM
Reply: