Add basic HTML files
This commit is contained in:
14
js/password-visibility.js
Normal file
14
js/password-visibility.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const passwordField = document.querySelector(
|
||||
".form .field input[type='password']"
|
||||
);
|
||||
toggleButton = document.querySelector(".form .field i");
|
||||
|
||||
toggleButton.onclick = () => {
|
||||
if (passwordField.type === "password") {
|
||||
passwordField.type = "text";
|
||||
toggleButton.classList.add("active");
|
||||
} else {
|
||||
passwordField.type = "password";
|
||||
toggleButton.classList.remove("active");
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user