HREFLANG Attribute | hreflang Property

Internet Development Index

Sets or retrieves the language code of the object.

Syntax

HTML<ELEMENT HREFLANG = sLang... >
Scriptingobject.hreflang(v) [ = sLang ]

Possible Values

sLangString that specifies or receives the language code.

The property is read/write. The property has no default value.

Remarks

You must set the value of this property before you can retrieve it.

Language codes identify natural languages that are spoken, written, or otherwise used for the communication of information among people, and are defined and explained in Tags for the Identification of Languages (RFC1766) Non-Microsoft link. Computer languages are explicitly excluded from language codes.

Example

In the a element in the following example, the HREFLANG attribute specifies the language code of the U.S. version of English.

<A HREF="http://example.microsoft.com/..." HREFLANG="en-US">anchor text</A>

Standards Information

This property is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 Non-Microsoft link.

Applies To

A, LINK