Ability to show password when logging in or registering

This commit is contained in:
2024-10-05 16:42:42 +02:00
parent 74c3a611a4
commit bd57db2b8c
6 changed files with 50 additions and 2 deletions

View File

@@ -56,3 +56,23 @@ passwordConfirm.addEventListener("input", () => {
document.getElementById("passwordConfirmNotice").className = "error";
}
})
let showPassword = document.getElementById("showPassword");
let showConfirmPassword = document.getElementById("showConfirmPassword");
showPassword.addEventListener("click", () => {
let password = document.getElementById("password");
if (showPassword.checked) {
password.type = "text";
} else {
password.type = "password";
}
})
showConfirmPassword.addEventListener("click", () => {
let password = document.getElementById("passwordConfirm");
if (showConfirmPassword.checked) {
password.type = "text";
} else {
password.type = "password";
}
})