1<!-- Button trigger modal -->
2<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalCenter">
3 Launch demo modal
4</button>
5
6<!-- Modal -->
7<div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
8 <div class="modal-dialog modal-dialog-centered" role="document">
9 <div class="modal-content">
10 <div class="modal-header">
11 <h5 class="modal-title" id="exampleModalCenterTitle">Modal title</h5>
12 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
13 <span aria-hidden="true">×</span>
14 </button>
15 </div>
16 <div class="modal-body">
17 ...
18 </div>
19 <div class="modal-footer">
20 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
21 <button type="button" class="btn btn-primary">Save changes</button>
22 </div>
23 </div>
24 </div>
25</div>
1<!-- Button trigger modal -->
2<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalCenter">
3 Launch demo modal
4</button>
5
6<!-- Modal -->
7<div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
8 <div class="modal-dialog modal-dialog-centered" role="document">
9 <div class="modal-content">
10 <div class="modal-header">
11 <h5 class="modal-title" id="exampleModalLongTitle">Modal title</h5>
12 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
13 <span aria-hidden="true">×</span>
14 </button>
15 </div>
16 <div class="modal-body">
17 ...
18 </div>
19 <div class="modal-footer">
20 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
21 <button type="button" class="btn btn-primary">Save changes</button>
22 </div>
23 </div>
24 </div>
25</div>
1<!-- Button trigger modal -->
2<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">
3 Launch demo modal
4</button>
5
6<!-- Modal -->
7<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
8 <div class="modal-dialog" role="document">
9 <div class="modal-content">
10 <div class="modal-header">
11 <h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
12 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
13 <span aria-hidden="true">×</span>
14 </button>
15 </div>
16 <div class="modal-body">
17 ...
18 </div>
19 <div class="modal-footer">
20 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
21 <button type="button" class="btn btn-primary">Save changes</button>
22 </div>
23 </div>
24 </div>
25</div>
1<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">
2 Launch demo modal
3</button>
4
5<!-- Modal -->
6<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
7 <div class="modal-dialog" role="document">
8 <div class="modal-content">
9 <div class="modal-header">
10 <h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
11 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
12 <span aria-hidden="true">×</span>
13 </button>
14 </div>
15 <div class="modal-body">
16 ...
17 </div>
18 <div class="modal-footer">
19 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
20 <button type="button" class="btn btn-primary">Save changes</button>
21 </div>
22 </div>
23 </div>
24</div>
1<!-- Bootstrap 5 Modal -->
2<!-- Button trigger modal -->
3<button
4 type="button"
5 class="btn btn-primary"
6 data-bs-toggle="modal"
7 data-bs-target="#exampleModal"
8>
9 Launch demo modal
10</button>
11
12<!-- Modal -->
13<div
14 class="modal fade"
15 id="exampleModal"
16 tabindex="-1"
17 aria-labelledby="exampleModalLabel"
18 aria-hidden="true"
19>
20 <div class="modal-dialog">
21 <div class="modal-content">
22 <div class="modal-header">
23 <h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
24 <button
25 type="button"
26 class="btn-close"
27 data-bs-dismiss="modal"
28 aria-label="Close"
29 ></button>
30 </div>
31 <div class="modal-body">...</div>
32 <div class="modal-footer">
33 <button
34 type="button"
35 class="btn btn-secondary"
36 data-bs-dismiss="modal"
37 >
38 Close
39 </button>
40 <button type="button" class="btn btn-primary">Save changes</button>
41 </div>
42 </div>
43 </div>
44</div>
1<div class="modal" tabindex="-1" role="dialog">
2 <div class="modal-dialog" role="document">
3 <div class="modal-content">
4 <div class="modal-header">
5 <h5 class="modal-title">Modal title</h5>
6 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
7 <span aria-hidden="true">×</span>
8 </button>
9 </div>
10 <div class="modal-body">
11 <p>Modal body text goes here.</p>
12 </div>
13 <div class="modal-footer">
14 <button type="button" class="btn btn-primary">Save changes</button>
15 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
16 </div>
17 </div>
18 </div>
19</div>
1$('#myModal').on('shown.bs.modal', function () {
2 $('#myInput').trigger('focus')
3})
1<!-- Button trigger modal -->
2<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#staticBackdrop">
3 Launch static backdrop modal
4</button>
5
6<!-- Modal -->
7<div class="modal fade" id="staticBackdrop" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
8 <div class="modal-dialog">
9 <div class="modal-content">
10 <div class="modal-header">
11 <h5 class="modal-title" id="staticBackdropLabel">Modal title</h5>
12 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
13 </div>
14 <div class="modal-body">
15 ...
16 </div>
17 <div class="modal-footer">
18 <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
19 <button type="button" class="btn btn-primary">Understood</button>
20 </div>
21 </div>
22 </div>
23</div>
24
1<div class="modal fade" tabindex="-1" role="dialog">
2 <div class="modal-dialog" role="document">
3 <div class="modal-content">
4 <div class="modal-header">
5 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
6 <h4 class="modal-title">Modal title</h4>
7 </div>
8 <div class="modal-body">
9 <p>One fine body…</p>
10 </div>
11 <div class="modal-footer">
12 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
13 <button type="button" class="btn btn-primary">Save changes</button>
14 </div>
15 </div><!-- /.modal-content -->
16 </div><!-- /.modal-dialog -->
17</div><!-- /.modal -->