Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <p><a id="myAnchor" hreflang="en-us" href="https://www.w3schools.com/">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> </html>