What has replaced the anchor tag's "name" attribute?

  • Thread starter existential.philosophy
  • Start date
E

existential.philosophy

I'm learning ASP.NET. On a page, I've created named locations with the
anchor tag like this: <a name="abc" />, and I've created links to
those tags like this: <a href="#abc">. That's the way I learned to do
it long ago, and it still works. However, Visual Studio gives me the
following warning:

Validation (XHTML 1.0 Transitional): Attribute 'name' is considered
outdated. A newer construct is recommended.

If the name attribute is really outdated, what is the new method I'm
supposed to be using?

-TC
 
R

Rain

In XHTML 1.0, the name attribute of these elements is formally deprecated,
and will be removed in a subsequent version of XHTML. Note that the html is
actually xhtml as per the document type declared at the top of the form by
visual studio.

I cant remember ever having a time where I had to use name ( although i
migh be wrong ), I think there are some dom methods which make use of the
attribute.

HTH
 
E

existential.philosophy

In XHTML 1.0, the name attribute of these elements is formally deprecated,
and will be removed in a subsequent version of XHTML. Note that the html  is
actually xhtml as per the document type declared at the top of the form by
visual studio.

I cant remember ever having a time where I  had to use name ( although i
migh be wrong ), I think there are some dom methods which make use of the
attribute.

HTH

Rain,

Thank you for the reply. If you don't use the "name" attribute, what
do you use instead when you want to create a link like the one I
described?

-TC
 
R

Rain

the id attribute.




In XHTML 1.0, the name attribute of these elements is formally deprecated,
and will be removed in a subsequent version of XHTML. Note that the html
is
actually xhtml as per the document type declared at the top of the form by
visual studio.

I cant remember ever having a time where I had to use name ( although i
migh be wrong ), I think there are some dom methods which make use of the
attribute.

HTH

Rain,

Thank you for the reply. If you don't use the "name" attribute, what
do you use instead when you want to create a link like the one I
described?

-TC
 
E

existential.philosophy

the  id attribute.





Rain,

Thank you for the reply. If you don't use the "name" attribute, what
do you use instead when you want to create a link like the one I
described?

-TC

Rain,

Thanks. That's exactly what I needed to know.

-TD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top