HTML DOM hreflang Property
Complete Anchor Object Reference
Definition and Usage
The hreflang property sets or returns the language code of the linked
resource.
Syntax
anchorObject.hreflang=languagecode
|
Example
The following example returns the language code of the linked resource:
<html>
<body>
<p><a id="myAnchor" hreflang="us-en"
href="http://www.w3schools.com">W3Schools.com</a></p>
<script type="text/javascript">
x=document.getElementById("myAnchor");
document.write(x.hreflang);
</script>
</body>
</html>
|
Try-It-Yourself Demos
Get
the language code of a linked resource
Complete Anchor Object Reference
|
|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|