Jquery 操作积累

来源:互联网 发布:php网站流量统计工具 编辑:程序博客网 时间:2024/05/21 15:46

//删除某个元素

$("#div_id").remove();

 

 

//获取Id是动态生成的元素

$('#' + bAccountId)s;

 

//获取元素的属性值

$("#chkId").attr("checked");

 

//设置元素的属性值

 

 

//获取某个div下所有选中的checkbox

$("#div_UserList input:checked");

 

 

//Checkbox的全选和反选

//全选
    $("#chkSelectAll_Top,#chkSelectAll_Bottom").click(function () {
        var thisVal = this.checked;
        $("#div_UserList input[type='checkbox']").each(function () {
            this.checked = thisVal;
        });
    });

    //反选
    $("#chkSelectInvert_Top,#chkSelectInvert_Bottom").click(function () {
        $("#div_UserList input[type='checkbox']").each(function () {
            this.checked = !this.checked;
        });
    });

$("#chkId").attr("checked","true");

原创粉丝点击