Return the language code of the linked document:
The result of x will be:
The hreflang property sets or returns the language code of the linked document.
The hreflang attribute does not render as anything special in any of the major browsers. However, it can be used by search engines, or in scripts.
Tip: To view all available language codes, go to our Language code reference.
The hreflang property is supported in all major browsers.
Return the hreflang property:
Set the hreflang property:
Value | Description |
---|---|
languagecode | Specifies the language code of the linked document |
Return Value: | A String, representing the language code of the linked document |
---|
Change the language code of the linked document:
HTML reference: HTML <link> hreflang attribute