> For the complete documentation index, see [llms.txt](https://docs.h5ui.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.h5ui.io/checkbox.md). Agents can also search and read this documentation through its [MCP server](https://docs.h5ui.io/~gitbook/mcp).

# Checkbox 复选框

在一组可选项中进行多选。

{% embed url="<https://h5ui.io/example/checkbox.html>" %}

<div align="left"><figure><img src="https://845300444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhAqktU0WcqWGe1q03GXN%2Fuploads%2FikvbL44kfk1SpiTHrcWN%2Fform-checkbox.png?alt=media&amp;token=e5b52bd5-dde3-4c39-8522-f8eff840ac3d" alt="" width="375"><figcaption></figcaption></figure></div>

```html
<div class="h5ui-checkbox" data-toggle="buttons">
    <label class="btn active">
        <input type="checkbox" checked="checked">
        <span class="h5ui-checkbox_bd">已选中</span>
        <span class="h5ui-checkbox_ft"></span>
    </label>

    <label class="btn active">
        <input type="checkbox" checked="checked">
        <span class="h5ui-checkbox_bd">已选中</span>
        <span class="h5ui-checkbox_ft"></span>
    </label>

    <label class="btn">
        <input type="checkbox">
        <span class="h5ui-checkbox_bd">未选</span>
        <span class="h5ui-checkbox_ft"></span>
    </label>

    <label class="btn disabled">
        <input type="checkbox">
        <span class="h5ui-checkbox_bd">锁定状态</span>
        <span class="h5ui-checkbox_ft"></span>
    </label>
</div>
```
