Javascript examples for DOM HTML Element:Link
Link hreflang Property - Change the language code of the linked document:
<!DOCTYPE html> <html> <head> <link id="myLink" href="http://java2s.com" hreflang="ja"> </head>/*from w w w. j a va2 s.c o m*/ <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myLink").hreflang = "en-us"; document.getElementById("demo").innerHTML = "The language code was changed from 'ja' to 'en-us'."; } </script> </body> </html>