input之checkbox用法

来源:互联网 发布:卖家卖假货淘宝介入 编辑:程序博客网 时间:2024/06/06 07:31
            function getFids(){                fids="";                $('input[name="chBox"]:checked').each(function(){                    fids+=$(this).val()+",";                });                fids=fids.substring(0,fids.length-1);                alert(fids);            }            function getAllFids(){                fids="";                if($('input[name="allBox"]').attr("checked")){//全选判定全选菜单是否选中                    $('input[name="chBox"]').each(function(){                        $(this).attr("checked",true);                        //alert($(this).attr("checked"));                        fids+=$(this).val()+",";                        fids=fids.substring(0,fids.length-1);                    });                }                else{                    $('input[name="chBox"]').each(function(){//遍历所有name位chBox的复选框                        $(this).attr("checked",false);                        //alert($(this).attr("checked"));                        fids="";                    });                }                //fids=fids.substring(0,fids.length-1);                //alert(fids);            }


0 0
原创粉丝点击