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

推荐订阅源

Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
N
Netflix TechBlog - Medium
腾讯CDC
C
Check Point Blog
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
S
SegmentFault 最新的问题
F
Fortinet All Blogs
美团技术团队
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
F
Full Disclosure
Recorded Future
Recorded Future
D
DataBreaches.Net
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
J
Java Code Geeks
I
InfoQ
Y
Y Combinator Blog
A
About on SuperTechFans
AI
AI
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Forbes - Security
Forbes - Security
W
WeLiveSecurity
M
MIT News - Artificial intelligence
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
Schneier on Security
Schneier on Security
The GitHub Blog
The GitHub Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Docker
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
V2EX - 技术
V2EX - 技术
Project Zero
Project Zero

博客园 - format

使用Arduino Nano驱动Lora模块 DIY一个物联网平台:想法 国内的maven镜像 Python Flask UnicodeDecodeError 编码错误解决 关于Python的web框架 NHibernate 3 中的 In 集合查询 在MVC 4 中使用自定义Membership [学习][Java] Struts2 与页面传值 (转) C++ Utf8字符转换Gb312编码,解决TinyXml中文乱码 Linux学习 -- Linux的可执行文件 WIN32简单的窗体代码,带函数功能注释 WINSocket编程 发生HTTP GET请求,并接收服务器返回 Win32 API 的文件操作 - format C++ 类中封装Win32API的回调函数 Win32编程 创建从资源文件定义的对话框 Oracle 数据库 用脚本建表空间 把UserControl通过代码控制输入HTML WebService调用时候的Object Moved 异常 ICTCLAS 平台调用的封装
jQuery 批量操作checkbox
format · 2017-05-06 · via 博客园 - format

困扰很久的问题:

如果只是

$('input[type=checkbox]').attr('checked',true);//全选
$('input[type=checkbox]').attr('checked',false);//不选择

 只能是第一全选和全不选有效,后面就失效了。

后来查到要这要操作:

//选中
$('#checkbox1').attr('checked',true);
$('#checkbox1').prop('checked',true);
//取消
$('#checkbox1').attr('checked',false);
$('#checkbox1').prop('checked',false);

posted on 2017-05-06 22:26  format  阅读(1691)  评论(0)    收藏  举报