checkbox 全选、半选、不选设置
2016-03-21 11:56
274 查看
html部分
js部分
function ts(cb) {
if (cb.readOnly)
cb.checked=cb.readOnly=false;
else if (!cb.checked)
cb.readOnly=cb.indeterminate=true;
}
indeterminate属性是独立属性,仅能在js中设置。
<input type="checkbox" onclick="ts(this)">
js部分
function ts(cb) {
if (cb.readOnly)
cb.checked=cb.readOnly=false;
else if (!cb.checked)
cb.readOnly=cb.indeterminate=true;
}
indeterminate属性是独立属性,仅能在js中设置。
相关文章推荐
- jQuery根据ID获取input、checkbox、radio、select的示例
- jquery实现的代替传统checkbox样式插件
- C#获取动态生成的CheckBox值
- Android控件之CheckBox、RadioButton用法实例分析
- asp.net动态产生checkbox(数据源为DB或内存集合)
- asp.net gridview中用checkbox全选的几种实现的区别
- asp.net treeview checkbox 相关问题
- IE中checkbox在刷新后初始化的问题
- javascript中checkbox使用方法简单实例演示
- 浅谈checkbox的一些操作(实战经验)
- asp.C#实现图片文件与base64string编码解码
- javascript中checkbox使用方法实例演示
- 多个datatable共存造成多个表格的checkbox都被选中
- javascript使用shift+click实现选择和反选checkbox的方法
- JS选中checkbox后获取table内一行TD所有数据的方法
- 用Javascript读取CheckBox数组的值的代码(兼容IE与firefox)
- 基于javascript实现checkbox复选框实例代码
- JS实现CheckBox复选框全选、不选或全不选功能
- javascript获取checkbox复选框获取选中的选项
- 关于树形菜单 Checkbox的全选