Latest web development tutorials

HTML DOM Link hreflang property

Link Object Reference Link Objects

Definition and Usage

hreflang attribute specifies the linked document the Chinese language.

grammar

Setting hreflang properties:

linkObject.hreflang="language-code"

Back hreflang properties:

linkObject.hreflang


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support hreflang property


Examples

Examples

Display linked documents Language:

<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ title>
<Link id = "link1" href = "domoarigato.htm" hreflang = "ja">
<Script>
function displayResult () {
var x = document.getElementById ( "link1") hreflang.;
alert (x);
}
</ Script>
</ Head>
<Body>

<Button type = "button" onclick = "displayResult ()"> displays the document language link element </ button>

</ Body>
</ Html>

try it"


Link Object Reference Link Objects