-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
30 lines (29 loc) · 833 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>Password Hidder</title>
</head>
<body>
<div class="container">
<input type="password" placeholder="Enter Password" id="input">
<img src="eye-icons/eye-close.png" id="img">
</div>
</body>
<script>
const inputBox = document.getElementById("input");
const img = document.getElementById("img");
img.onclick = function toggleEye(){
if(inputBox.type == "password"){
inputBox.type = "text";
img.src = "eye-icons/eye-open.png";
}
else{
inputBox.type = "password";
img.src = "eye-icons/eye-close.png";
}
}
</script>
</html>