1 jquery对checkbox的简单操作
//全選和全不選 vote
function selectAll(){
?if($(":checkbox").prop('checked')){
?????//$(":checkbox").removeAttr('checked');//attr不兼容了jquery1.6以上
?????$(":checkbox").prop('checked',false);
?}else{
?????$(":checkbox").prop('checked',true);
?}
}
//刪除選中的選項
function delselect(url,says){?
?if(confirm(says)){
???if($(":checkbox").prop('checked')){//排出無選則的情況
????? var s='';
????? var urls='';
???? $(":checked").each(function(i){//遍歷已經(jīng)選中的值,并且做連接處理。
????? s+=$(this).val()+',';
???? });
?????urls=url+s;
?????window.location.href=urls;
?????return true;
???}
???else{
????alert('no checked find!');return false;
???}
?}
?else{
??
?????? return false;
?}
?
}
轉(zhuǎn)載于:https://www.cnblogs.com/legend-song/p/3658810.html
總結
以上是生活随笔為你收集整理的1 jquery对checkbox的简单操作的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ISA Server 2006 升级到
- 下一篇: python修改app定位_APP自动化