Get the language code of a link:
The result of x will be:
The hreflang property sets or returns the value of the hreflang attribute of a link.
The hreflang attribute specifies the language of a linked document.
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 a two-letter language code that represents the language of the linked document. |
Return Value: | A String, representing the language of the linked document |
---|
Change the language code of a link:
HTML reference: HTML <a> hreflang attribute