Jquery-mobile-checkbox-disabled

提供:Dev Guides
移動先:案内検索

jQuery Mobile-チェックボックス無効

説明

入力で属性 _disabled = "" _ を設定して、チェックボックスを無効にします。

次の例は、jQuery Mobileで無効なチェックボックステーマを使用する方法を示しています。

<!DOCTYPE html>
<html>
   <head>
      <meta name = "viewport" content = "width = device-width, initial-scale = 1">
      <link rel = "stylesheet" href = "https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
      <script src = "https://code.jquery.com/jquery-1.11.3.min.js"></script>
      <script src = "https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
   </head>

   <body>
      <h2>Disabled Checkbox Example</h2>
      <form>
         <fieldset data-role = "controlgroup">
            <input disabled = "" type = "checkbox" id = "checkbox 1" data-theme = "b"/>
            <label for = "checkbox 1">Checkbox 1</label>

            <input disabled = "" type = "checkbox" id = "checkbox 2" data-theme = "b"/>
         </fieldset>
      </form>
   </body>
</html>

出力

上記のコードがどのように機能するかを確認するために、次の手順を実行してみましょう-

  • 上記のHTMLコードを disabledl ファイルとしてサーバーのルートフォルダーに保存します。
  • このHTMLファイルをhttp://localhost/disabledlとして開くと、次の出力が表示されます。