Javascript examples for DOM HTML Element:Anchor
Anchor password Property - Change the password part of a link:
<!DOCTYPE html> <html> <body> <p><a id="myAnchor" href="https://myUserName:password123@www.example.com">Example link</a></p> <button onclick="myFunction()">change the password part of the link above</button> <p id="demo"></p> <script> function myFunction() {// w w w . jav a2s .c o m document.getElementById("myAnchor").password = "newPassword101"; document.getElementById("demo").innerHTML = "The password was changed from 'password123' to 'newPassword101'."; } </script> </body> </html>