Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<p><a id="myAnchor" href="https://johnsmith:smith123@www.example.com/">Example link</a></p>
<p>Click the button to change the password part of the link above.</p>
<button onclick="myFunction()">Try it</button>
<p><b>Note:</b> The password property is not supported in Internet Explorer, Safari and Opera version 12 (and earlier).</p>
<p id="demo"></p>
<script>
function myFunction() {
  document.getElementById("myAnchor").password = "newPassword101";
  document.getElementById("demo").innerHTML = "The password was changed from 'smith123' to 'newPassword101'.";
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_anchor_password2 by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 18:16:45 GMT -->
</html>