使用 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-Jun-2020

13K+ 瀏覽量

開啟你的 職業

透過完成課程獲得認證

開始
廣告
© . All rights reserved.