checkbox怎么判断是否选中
2016-04-16 21:27
211 查看
下面这种可以使用
if($("#checkbox1").is(':checked')) {
alert("1");
} else {
alert("0");
}
还有的说以下两种
方法一:
if ($("#checkbox-id").get(0).checked) {
// do something
}
方法二:
if ($('#checkbox-id').attr('checked')) {
// do something
}
但是没有效果
if($("#checkbox1").is(':checked')) {
alert("1");
} else {
alert("0");
}
还有的说以下两种
方法一:
if ($("#checkbox-id").get(0).checked) {
// do something
}
方法二:
if ($('#checkbox-id').attr('checked')) {
// do something
}
但是没有效果
相关文章推荐
- Location and Maps(位置和地图)——翻译自developer.android.com
- 关于kinfu的配置问题,pcl_kinfu_largeScale
- JSON之Jackson(一)
- Windows 系统安装 Apache 服务器
- nuc2016第一次月赛B。。对称素数
- struts2中配置文件加载的顺序是什么?
- NYOJ 116 士兵杀敌(二)
- Linux环境下DHCP服务器的搭建
- php7连不上mysql求帮忙!!!
- Atitit.h5 web webview性能提升解决方案-----fileStrore缓存离线存储+http方案
- EasyUI-datebox formatter
- DS3231时钟模块应用的一点感悟
- Atitit.h5 web webview性能提升解决方案-----fileStrore缓存离线存储+http方案
- 虚拟机上网设置dhcp
- Android Studio 修改项目包名(任意级)
- Atitit.提升软件Web应用程序 app性能的方法原理 h5 js java c# php python android .net
- 使用springmvc遇到的问题
- C++实现单链表的创建和打印
- 关于js封装框架类库之事件模块
- Atitit.提升软件Web应用程序 app性能的方法原理 h5 js java c# php python android .net