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

108 次瀏覽

開啟你的 職業

透過完成教程取得認證

開始
廣告
© . All rights reserved.