Link hreflang property

HTML DOM Link hreflang property Link object

Definitions and usages

The hreflang property specifies the language in which the Chinese is spoken.

Grammar

Set the hreflang property:

linkObject.hreflang=" language-code "

Return the hreflang property:

linkObject.hreflang


Browser support

HTML DOM Link hreflang property HTML DOM Link hreflang property HTML DOM Link hreflang property HTML DOM Link hreflang property HTML DOM Link hreflang property

The hreflang property is supported by all major browsers


The language in which the linked document is displayed:

<! DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
Online tutorials for W3Cschool (w3cschool.cn)
<link id="link1" href="domoarigato.htm" hreflang="ja">
<script>
function displayResult(){
var x=document.getElementById("link1").hreflang;
alert(x);
}
</script>
</head>
<body>

The document language of the displayResult() shows the linked elements.

</body>
</html>

Try it out . . .


HTML DOM Link hreflang property Link object