From fef5052a197edd4cb50dca659831fe5ec3057961 Mon Sep 17 00:00:00 2001 From: asmaamostafa74 Date: Tue, 29 Oct 2024 14:58:02 +0300 Subject: [PATCH] Password Eye Icon --- src/js/script.js | 16 +++++++++++++++- src/login.html | 24 ++++++++++++------------ src/signUp.html | 12 ++++++------ 3 files changed, 33 insertions(+), 19 deletions(-) diff --git a/src/js/script.js b/src/js/script.js index 2bd4e26..5b8b492 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -242,4 +242,18 @@ document.addEventListener("DOMContentLoaded", function() { }) .catch(error => console.log('Error loading the Breadcrumb:', error)); -}); \ No newline at end of file +}); + +// For Password Eye Icon +function togglePassword(icon) { + const passwordInput = icon.closest('.relative').querySelector('input[type="password"], input[type="text"]'); + const eyeIcon = icon.querySelector('i'); + + if (passwordInput.type === 'password') { + passwordInput.type = 'text'; + eyeIcon.classList.replace('fa-eye-slash', 'fa-eye'); + } else { + passwordInput.type = 'password'; + eyeIcon.classList.replace('fa-eye', 'fa-eye-slash'); + } +} diff --git a/src/login.html b/src/login.html index fe58d0c..c3a7655 100644 --- a/src/login.html +++ b/src/login.html @@ -53,10 +53,10 @@ Forget Password?
- - - Eye Icon - + + + +