如何使用 Bootstrap 警報外掛
警報訊息用於向終端使用者顯示警告或確認等資訊。
你可以嘗試執行以下程式碼,在 Bootstrap 中實施警報外掛 −
示例
<!DOCTYPE html> <html> <head> <title>Bootstrap Example</title> <link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet"> <script src = "/scripts/jquery.min.js"></script> <script src = "/bootstrap/js/bootstrap.min.js"></script> </head> <body> <div id = "myAlert" class = "alert alert-success"> <a href = "#" class = "close" data-dismiss = "alert">×</a> <strong>Success!</strong> the result is successful. </div> <script> $(function(){ $("#myAlert").bind('closed.bs.alert', function () { alert("Alert message box is closed."); }); }); </script> </body> </html>
廣告