+ 1
What is name attribute of anchor tag?plz explain in detail?
4 Answers
+ 2
Hi Afreen Saba,
By including anĀ anchor tagĀ within a post or page, you can place links in the body of your page which when clicked allow the reader/user to jump to another location on the page.
# equals the name attribute
Syntax: (== is equal to)
#value == name="value"
# == name
value == value
<li><a href="#linkOne">Link one</a></li>
<li><a href="#linkTwo">Link two</a></li>
<div><a name="linkOne">Anchor one</a></div>
<span><a name="linkTwo">Anchor two</a></span>
Name attribute of anchor tag explainedš:
https://www.expression-web-tutorials.com/anchor-tags.html
Have a look at this sourceš:
https://stackoverflow.com/questions/484719/should-i-make-html-anchors-with-name-or-id
Additional sources:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a
+ 2
Name attribute in anchor tag is obsoleted in HTML5, use id # instead.
More information please check
https://www.w3.org/TR/html5-diff/
" The following attributes are allowed but Web developers are discouraged from using them and instead strongly encouraged to use an alternative solution:
TheĀ borderĀ attribute onĀ img. It is required to have the value "0" when present. Web developers can use CSS instead.
TheĀ languageĀ attribute onĀ script. It is required to have the value "JavaScript" (case-insensitive) when present and cannot conflict with theĀ typeĀ attribute. Web developers can simply omit it as it has no useful function.
TheĀ nameĀ attribute onĀ a. Web developers can use theĀ id attribute instead. "
+ 2
Hi,Vincent Berger
Thank you for explaining.
šš
+ 1
Calvin
thanks for giving me the answer