惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
I
InfoQ
H
Hackread – Cybersecurity News, Data Breaches, AI and More
aimingoo的专栏
aimingoo的专栏
小众软件
小众软件
有赞技术团队
有赞技术团队
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
大猫的无限游戏
大猫的无限游戏
Engineering at Meta
Engineering at Meta
B
Blog RSS Feed
博客园_首页
Y
Y Combinator Blog
V
Visual Studio Blog
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence
雷峰网
雷峰网
博客园 - 司徒正美
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
H
Help Net Security
P
Proofpoint News Feed
B
Blog
云风的 BLOG
云风的 BLOG
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

博客园 - 雪夜

VS统计代码量 DataTable 操作 - 雪夜 - 博客园 统计销售额 bootstrap 知识点 人脸识别 参考 转盒子 年龄段统计 model 数据注解 delphi ScriptGate 调用JS C#区块链零基础入门,学习路线图 转 SQLServer 2005 和自增长主键identity说再见——NEWSEQUENTIALID() ASP.NET Core and .NET Core Library Support 创新县(市、区)的主要条件 C# imgage图片转base64字符/base64字符串转图片另存成 base64编码的 文件 图片 CSS - 雪夜 - 博客园 Exception has been thrown by the target of an invocation 网站报错 高效通用分页存储过程 多表查询 JavaScript 知识记录 博文阅读密码验证 - 博客园
JQuery 全选 取消
雪夜 · 2017-02-20 · via 博客园 - 雪夜

            $('#chkAllProp').click(function () {
                $("input[id*='chkSelect']").prop("checked", function (i, val) {
                    return !val;
                });
            });
                            <asp:TemplateField HeaderText="选择">
                                <HeaderTemplate>
                                    <input id="chkAllProp" type="checkbox" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkSelect" runat="server" />
                                </ItemTemplate>
                                <ItemStyle Width="60px" />
                            </asp:TemplateField>

$("input[id^='code']");//id属性以code开始的所有input标签

$("input[id$='code']");//id属性以code结束的所有input标签

$("input[id*='code']");//id属性包含code的所有input标签

$("tbody tr:even"); //选择索引为偶数的所有tr标签

$("tbody tr:odd"); //选择索引为奇数的所有tr标签

$("#code input:not([id^='code'])");//id为code标签内不包含id以code开始的所有input标签

$('#someField').val($.trim($('#someField').val()));//消除空格,语法:$.trim(value)