Skip to content
陈广亮的技术博客
Go back

Checkbox 模糊状态(indeterminate)

Checkbox 有一个模糊状态(上面显示一条横线),通过 indeterminate 属性实现:

input.indeterminate = true;

// jQuery
input.prop("indeterminate", true);

indeterminate 属性只能使用 JS 来设置,不能通过 HTML 属性设置。


Share this post on:

Previous Post
用按位非 ~ 简化 indexOf 判断
Next Post
正则表达式的复制与 lastIndex