开发者

Difference between title and name in html href element

开发者 https://www.devze.com 2023-01-08 14:22 出处:网络
in an href in html, whats the difference between using <a href=\"http://www.somesite.com/\" name=\"The Name\">

in an href in html, whats the difference between using

<a href="http://www.somesite.com/" name="The Name">

and

&l开发者_JAVA技巧t;a href="http://www.somesite.com/" title="The Name">

Is there any advantage to using one over the other?

Thanks


Look it up in the spec, or better yet a resource that condenses the spec a bit. (And, then the spec if that isn't enough.)

title   text    Specifies extra information about an element

http://www.w3schools.com/tags/tag_a.asp

The name attribute specifies the name of an anchor.

The name attribute is used to create a bookmark inside a document.

The href or the name attribute must be present in the tag

http://www.w3schools.com/tags/att_a_name.asp

So, the name of the anchor is used for links like exampledomain.com/index.php#some_section, which would bring that anchor into focus on the page.

Many modern browsers will display the title attribute in a tooltip when hovering over the link. It's likely also useful for screen readers and such.


markup tag Node - Name -- is to identify the element and for lookup - title -- is default toolTip property. like ALT

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号