使用 Bootstrap 停用按鈕


在 Bootstrap 中使用 .disabled 類來停用按鈕。

您可以嘗試執行以下程式碼來實現 .disabled 類−

示例

線上演示

<!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>
   <body>
      <div class = "container">
         <h2>Rank of Cricketers</h2>
         <p>The following are the rank of cricketers:</p>
         <button type = "button" class = "btn btn-primary">Enabled</button>
         <button type = "button" class = "btn btn-primary disabled">Disabled</button>
      </div>
   </body>
</html>

更新於:12-6 月-2020

超過 1.3 萬次瀏覽

開啟您的 職業 生涯

完成課程並獲得認證

開始學習
廣告
© . All rights reserved.