<html>
<body>
<p><a id="myAnchor" hreflang="en-us" href="../index.html">W3Schools</a></p>
<p>Click the button to change the value of the hreflang attribute of the link to "fr".</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
document.getElementById("myAnchor").hreflang = "fr";
document.getElementById("demo").innerHTML = "The hreflang value of the link was changed from 'en-us' to 'fr'.";
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_anchor_hreflang2 by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 18:16:45 GMT -->
</html>