HTML DOM Link hreflang property
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
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>
<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 Objects