如何使用 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>

更新日期:2020 年 6 月 12 日

108 次觀看

開啟您的職業

完成課程以獲取認證

開始學習
廣告