Do you mean you want let the user show/hide the password instead of the dots in the password field? If so you can do it like this:
<input id="password" name="password" type="password" value="" confirm="" required="true">
<input id="showpassword" type="checkbox" onclick="showPW()">
<label for="showpassword">Show password</label>
<script>
function showPW() {
var x = document.getElementById("password");
if (x.type === "password") {
x.type = "text";
} else {
x.type = "password";
}
}
</script>
This works by displaying the login info that the user has stored in their browser, it can't pull info from the database.