The a element represents a hyperlink.
global attributes & href & target & rel & hreflang & media & type & common.attrs.aria or notAllowed
_blank
",
"_self
",
"_parent
",
or
"_top
".
An a element must have both a start tag and an end tag.
any element that can contain phrasing elements, any element that can contain flow elements
Although previous versions of HTML restricted the a element to only containing phrasing content (essentially, what was in previous versions referred to as “inline” content), the a element is now transparent; that is, an instance of the a element is now allowed to also contain flow content (essentially, what was in previous versions referred to as “block” content)—if the parent element of that instance of the a element is an element that is allowed to contain flow content.
interface HTMLAnchorElement : HTMLElement { stringifier attribute DOMString href; attribute DOMString target; attribute DOMString rel; readonly attribute DOMTokenList relList; attribute DOMString media; attribute DOMString hreflang; attribute DOMString type; attribute DOMString text; // URL decomposition IDL attributes attribute DOMString protocol; attribute DOMString host; attribute DOMString hostname; attribute DOMString port; attribute DOMString pathname; attribute DOMString search; attribute DOMString hash; };
A hyperlink intended to be useful in output for all media
types except the print
media type.
<a href="./page2.html" rel=next media="not print">next</a>
The name attribute is obsolete.
<a name="section5"/>
<a>prev</a>
A hyperlink that will cause its target to be opened in a new browsing context.
<a href="http://help.example.com" target="_blank">Help</a>
The value of the href attribute contains a space character.
some <a href="http://example.com/Archive/Public Data/">public</a> data is also available
A hyperlink that represents multiple link types.
<a href="../toc.html" rel="index up">up</a>
A hyperlink that contains a paragraph.
<a href="javascript:void(0);" onmouseover="return anno('Note: This paragraph is informative only.') onmouseout="return anno_bye();"> <p>The following is introductory information…</p> </a>