-
Notifications
You must be signed in to change notification settings - Fork 0
/
hidepassword.html
57 lines (57 loc) · 1.5 KB
/
hidepassword.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
*{
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body{
background: #250032;
}
.input-box{
background: #fff;
width: 90%;
max-width: 500px;
border-radius: 5px;
padding: 10px 20px;
margin: 300px auto;
}
.input-box input{
font-size: 18px;
width: 90%;
border: none;
outline: none;
font-weight: 600;
}
#img{
width: 30px;
cursor: pointer;
}
</style>
</head>
<body>
<div class="input-box">
<input type="text" id="password">
<img src="https://p.kindpng.com/picc/s/200-2005170_blind-eye-visually-challenged-impaired-comments-hd-png.png" id="img">
</div>
<script>
let password = document.getElementById("password");
let img = document.getElementById("img")
img.onclick = function(){
if(password.type === "text"){
password.type = "password";
img.src = "https://www.kindpng.com/picc/m/340-3408991_password-eyes-eye-icon-for-password-png-transparent.png";
}else{
password.type = "text";
img.src = "https://p.kindpng.com/picc/s/200-2005170_blind-eye-visually-challenged-impaired-comments-hd-png.png";
}
}
</script>
</body>
</html>