【js】checkbox总结(待续...)

1.checkbox 单选

http://www.cnblogs.com/CESC4/p/7791821.html

2.checked的选中和未选中

http://www.cnblogs.com/CESC4/p/7643963.html

3.获取radio 或者check选定的值。

http://www.cnblogs.com/CESC4/p/7456827.html 不可用了

http://www.jb51.net/article/48361.htm

https://www.cnblogs.com/td960505/p/6123510.html

4.查找选中的checkbox个数

http://www.cnblogs.com/CESC4/p/7395118.html

5.attr()与prop()

http://blog.csdn.net/u012124564/article/details/47837615

 

 

var locationType=[];
$("#locationCheck input[type='checkbox']:checked").each(function(){
// var sfruit=$(this).val();
// alert(sfruit);
locationType.push($(this).val());
});
console.log(locationType);
console.log('分割线');

$("#locationCheck").find("input[type='checkbox']:checked").each(function () {
// console.log($(this).val());
locationType.push($(this).val());
});
console.log(locationType);

 

posted @ 2017-11-06 10:32  Legolas_4  阅读(153)  评论(0编辑  收藏  举报