-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path12-模态框.html
54 lines (54 loc) · 2.36 KB
/
12-模态框.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link href="./bootstrap-3.4.1/dist/css/bootstrap.min.css" rel="stylesheet"/>
<script src="./jquery-3.6.0.js"></script>
<script src="./bootstrap-3.4.1/dist/js/bootstrap.min.js"></script>
</head>
<body>
<button class="btn btn-primary" data-toggle="modal" data-target="#myModal">展示模态框</button>
<button class="btn btn-primary" id="btn">展示模态框</button>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">模态框(Modal)标题</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" role="form">
<div class="form-group">
<label for="uname" class="col-md-2 control-label">姓名</label>
<div class="col-md-8">
<input type="text" id="uname" class="form-control" placeholder="请输入姓名">
</div>
</div>
<div class="form-group">
<label for="upwd" class="col-md-2 control-label">密码</label>
<div class="col-md-8">
<input type="text" id="upwd" class="form-control" placeholder="请输入密码">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="sunmit_btn">提交更改</button>
</div>
</div>
</div>
</div>
<script>
$("#btn").click(function(){
$("#myModal").modal("show");
});
$("sunmit_btn").click(function(){
$("#myModal").modal('hide');
});
</script>
</body>
</html>