<!DOCTYPE html>
<html>
<head>
<link id="myLink" href="domoarigato.htm" hreflang="ja">
</head>
<body>
<p>Click the button to return the language code of the linked document.</p>
<p>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.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myLink").hreflang;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>