Prev Demo
Bootstrap
>
Modal Method
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title></title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <style> #myBtn { width: 300px; padding: 10px; font-size: 20px; position: absolute; margin: 0 auto; right: 0; left: 0; bottom: 50px; z-index: 9999; } </style> </head> <body> <div class="container"> <h2>Modal Methods</h2> <button type="button" class="btn btn-info btn-md" id="myBtn">Hide Modal</button> <div class="modal fade" id="myModal" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title">Modal Methods</h4> </div> <div class="modal-body"> Displays content in the body </div> <div class="modal-footer"> <button class="btn btn-success btn-lg">Modal footer</button> </div> </div> </div> </div> </div> <script> $(document).ready(function () { $("#myModal").modal("show"); $("#myBtn").click(function () { $("#myModal").modal("hide"); }); }); </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output