-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvanilla-1.html
50 lines (40 loc) · 1009 Bytes
/
vanilla-1.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
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<title>HTML template</title>
</head>
<body>
<form class="form p-4">
<div class="form-group">
<label for="username">Username</label>
<input type="text" name="username" id="username">
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" name="password" id="password">
</div>
<div class="form-group">
<label for="show-password">
<input type="checkbox" name="show-passwords" id="show-password">
Show password
</label>
</div>
<p>
<button type="submit" class="btn btn-primary">Log In</button>
</p>
</form> <!-- #container -->
<script>
var check = document.querySelector('#show-password');
var password = document.querySelector('#password');
check.addEventListener('click', function (event) {
if (check.checked === true) {
password.type = 'text';
}
else {
password.type = 'password';
}
});
</script>
</body>
</html>