jQuery实现全选/反选

<script language="javascript" type="text/javascript">
    function ckall(e, obj) {
        if ($(e).attr("checked")!="checked") {
            $('#' + obj + ">input").removeAttr("checked"); 
        }
        else {
            $('#' + obj + ">input").attr("checked", "checked");  
        }
    }
</script>

 

<tr>  
    <td><%=this.FunctionName %></td>
    <td>
        <input id="chk_<%=this.ClientID %>" type="checkbox" οnclick="ckall(this,'fun_<%=this.ClientID %>')"/>全选
        <span id="fun_<%=this.ClientID %>">
            <asp:CheckBox ID="ckinsert" runat="server"  Text="新增"/>
            <asp:CheckBox ID="ckedit" runat="server"  Text="编辑"/>
            <asp:CheckBox ID="ckdelete" runat="server"  Text="删除"/>
            <asp:CheckBox ID="ckview" runat="server"  Text="查看"/>
            <asp:CheckBox ID="ckexecute" runat="server" Text="执行" />
            <asp:CheckBox ID="cklist" runat="server"  Text="列表"/>
            <asp:CheckBox ID="ckprint" runat="server" Text="打印" />
        </span>
    </td>
</tr>

转载于:https://www.cnblogs.com/jbbk/archive/2012/09/26/2704073.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值