全选和反选
来源:互联网 发布:网络自由度排名 编辑:程序博客网 时间:2024/05/22 17:04
$("#checkall").click(function(){
/*$("input[name='checkbox']").attr("checked","true");*/
$("input[name='checkbox']").each(function(){
if($(this).prop("checked")){
$(this).removeAttr("checked");
}else{
$(this).prop("checked","true");
}
});
});
$("#delete").click(function(){
var $cks =$("table :checkbox:checked");
var nameArr = [ ];
$cks.each(function () {
if ($.inArray($(this).attr("name"), nameArr) == -1) {
nameArr.push($(this).attr("name"));
}
/*$("input[name='checkbox']").attr("checked","true");*/
$("input[name='checkbox']").each(function(){
if($(this).prop("checked")){
$(this).removeAttr("checked");
}else{
$(this).prop("checked","true");
}
});
});
$("#delete").click(function(){
var $cks =$("table :checkbox:checked");
var nameArr = [ ];
$cks.each(function () {
if ($.inArray($(this).attr("name"), nameArr) == -1) {
nameArr.push($(this).attr("name"));
}
});
阅读全文
0 0
- 全选和反选
- 全选和反选
- 全选和反选
- 全选和反选
- 全选和反选
- 全选和反选
- 全选和反选
- 全选和反选
- 全选和反选
- checkbox全选,反选和取消全选
- checkbox全选和反选
- javascript全选和反选
- 全选、全不选和反选
- select 全选和反选
- js全选和反选
- javascript全选和反选
- js全选和反选
- js全选和反选
- JAVA中Equals和==的区别
- IntelliJ Idea 常用快捷键列表
- unity反向查找资源依赖
- std::map::find
- OpenGL坐标系变换(深度好文)
- 全选和反选
- Tiny4412 Android 启动流程
- java 正则表达式获取指定两个字符串之间内容
- 在没有GPU的mac上安装opencv3+contrib教程
- Linux CentOS 6.5 中安装与配置JDK-7
- 6.10水仙花数
- 软硬链接 文件查找(find)
- Spring Boot引用本地jar包
- MySQL查看授权