hreflang property
The hreflang
property of the HTMLAnchorElement interface is a
string that is the language of the linked resource.
It reflects the hreflang
attribute of the a
element and is the empty
string (""
) if there is no hreflang
element.
Web browsers and search engines may use this information to understand the
language of the linked content better, but they are not required to follow
it. The value provided for the hreflang
attribute adheres to the format
defined in 5646, "Tags for Identifying Languages (also known as BCP 47)"
. If not, it is ignored.
Web browsers do not rely solely on the hreflang
attribute after fetching
the linked resource. Instead, they use language information directly
associated with the resource (e.g., through HTTP headers) to determine its
language.
Implementation
external String get hreflang;
Implementation
external set hreflang(String value);