HTML
CSS
JavaScript
HTML
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>选择控件 - 复选框</title>
  <link rel="stylesheet" href="https://cdn.w3cbus.com/library/mdui/1.0.2/css/mdui.min.css"/>
</head>
<body>

  <div class="mdui-container">
    <div class="mdui-row-md-4">
      <div class="mdui-col">
        <label class="mdui-checkbox">
          <input type="checkbox"/>
          <i class="mdui-checkbox-icon"></i>
          默认不选中
        </label>
      </div>
      <div class="mdui-col">
        <label class="mdui-checkbox">
          <input type="checkbox" checked/>
          <i class="mdui-checkbox-icon"></i>
          默认选中
        </label>
      </div>
      <div class="mdui-col">
        <label class="mdui-checkbox">
          <input type="checkbox" disabled/>
          <i class="mdui-checkbox-icon"></i>
          禁用,且不选中
        </label>
      </div>
      <div class="mdui-col">
        <label class="mdui-checkbox">
          <input type="checkbox" disabled checked/>
          <i class="mdui-checkbox-icon"></i>
          禁用,且选中
        </label>
      </div>
    </div>
    <div class="mdui-row-md-4">
      <div class="mdui-col">
        <label class="mdui-checkbox">
          <input type="checkbox" id="indeterminate-demo1"/>
          <i class="mdui-checkbox-icon"></i>
          不确定状态
        </label>
      </div>
      
      <div class="mdui-col">
        <label class="mdui-checkbox">
          <input type="checkbox" disabled id="indeterminate-demo2"/>
          <i class="mdui-checkbox-icon"></i>
          禁用,且不确定状态
        </label>
      </div>
      <script>
        document.getElementById('indeterminate-demo2').indeterminate = true;
      </script>
    </div>
  </div>

  <script src="https://cdn.w3cbus.com/library/mdui/1.0.2/js/mdui.min.js"></script>
</body>
</html>
CSS

  
JavaScript
document.getElementById('indeterminate-demo1').indeterminate = true;