password hide and show data

 <!DOCTYPE html>

<html>

<body>


<p>Click the radio button to toggle between password visibility:</p>


Password: <input type="password" value="FakePSW" id="myInput"><br><br>

<input type="checkbox" onclick="myFunction()">Show Password


<script>

function myFunction() {

  var x = document.getElementById("myInput");

  if (x.type === "password") {

    x.type = "text";

  } else {

    x.type = "password";

  }

}

</script>


</body>

</html>


Comments