Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
HTML and CSS
Properties
 hreflang Property
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, HTMLAnchorElement Constructor, HTMLLinkElement Constructor
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2010 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker