www.fgks.org   »   [go: up one dir, main page]

HREFLANG Attribute | hreflang Property

Sets or retrieves the language code of the object.

Syntax

HTML<ELEMENT HREFLANG = sLang... >
Scripting[ sLang = ] object.hreflang [ = v ]

Possible Values

sLangString that specifies or receives the language code.

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

Remarks

hreflang was introduced in Microsoft Internet Explorer 6

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) World Wide Web 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 World Wide Web link.

Applies To

A, LINK


MSDN Library
Web Development
HTML and CSS
HTML and DHTML Reference
Properties
hreflang