Skip to content

Commit f0c2756

Browse files
committed
Show Hide PASSWORD Update
1 parent 0c82321 commit f0c2756

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

28. Show Hide Password/app.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,5 @@ const input = document.querySelector("input");
22
const eye = document.querySelector("#eye-icon");
33

44
eye.addEventListener("click", () => {
5-
// if (input.type === "password") {
6-
// input.type = "text";
7-
// } else {
8-
// input.type = "password";
9-
// }
10-
11-
// REFACTOR
125
input.type === "password" ? (input.type = "text") : (input.type = "password");
136
});

28. Show Hide Password/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
<div class="container">
1818
<input type="password" placeholder="Password" />
1919
<div class="eye-container">
20-
<i class="fa fa-eye" aria-hidden="true" id="eye-icon"></i>
20+
<svg width="30" height="30" class="eye-open" id="eye-icon" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
21+
<path fill-rule="evenodd" d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5ZM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5Zm-3-5c0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3-3-1.34-3-3Z" clip-rule="evenodd"></path>
22+
</svg>
2123
</div>
2224
</div>
2325

0 commit comments

Comments
 (0)