mirror of
https://github.com/AdrienHallet/HaitiWater.git
synced 2026-10-29 02:46:43 +00:00
12 lines
480 B
JavaScript
12 lines
480 B
JavaScript
function togglePasswordVisibility(){
|
|
let passwordField = document.getElementById('id_password');
|
|
let toggleIcon = document.getElementById('password-visibility-toggle');
|
|
if (passwordField.type === "password"){
|
|
passwordField.type = "text";
|
|
console.log(toggleIcon);
|
|
toggleIcon.classList.replace('fa-eye', 'fa-eye-slash');
|
|
} else {
|
|
passwordField.type = "password";
|
|
toggleIcon.classList.replace('fa-eye-slash', 'fa-eye');
|
|
}
|
|
} |