forked from wenzhixin/bootstrap-show-password
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathv2.html
51 lines (50 loc) · 1.44 KB
/
v2.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Bootstrap show password</title>
<link rel="stylesheet" href="assets/bootstrap-v2/css/bootstrap.css">
<style>
.v2 input {
vertical-align: top;
}
</style>
</head>
<body class="v2">
<div style="width: 300px; margin: 50px auto;">
<p>
<input id="password"
type="password"
value="123"
placeholder="password">
</p>
<p><label><input id="methods" type="checkbox"> Show password</label></p>
<p id="eventLog">Event log</p>
<hr>
<p>
<input data-toggle="password"
data-placement="before"
type="password"
value="123"
placeholder="password">
</p>
</div>
<script src="assets/jquery.min.js"></script>
<script src="assets/bootstrap-v2/js/bootstrap.js"></script>
<script src="bootstrap-show-password.js"></script>
<script>
$(function () {
$('#password').password().on('show.bs.password',function (e) {
$('#eventLog').text('On show event');
$('#methods').prop('checked', true);
}).on('hide.bs.password', function (e) {
$('#eventLog').text('On hide event');
$('#methods').prop('checked', false);
});
$('#methods').click(function () {
$('#password').password('toggle');
});
});
</script>
</body>
</html>