获取多选框的值 .net JS JQ PHP JAJVA

    text = $("input:checkbox[name='cat_id']:checked").map(function (index, elem) {
        return $(elem).val();
    }).get().join(',');
    alert("选中的checkbox的值为:" + text);

                                       <span> <input type="checkbox" value="28" name="cat_id">网络推广</span>
                                        <span> <input type="checkbox" value="29" name="cat_id">网络投票</span>
                                        <span> <input type="checkbox" value="30" name="cat_id">网络营销</span>
                                        <span> <input type="checkbox" value="31" name="cat_id">SEO优化</span>
                                        <span> <input type="checkbox" value="32" name="cat_id">外包推广</span>
                                        <span> <input type="checkbox" value="33" name="cat_id">微信推广</span>
                                        <span> <input type="checkbox" value="34" name="cat_id">QQ推广</span>
                                        <span> <input type="checkbox" value="35" name="cat_id">店铺推广</span>
                                        <span> <input type="checkbox" value="36" name="cat_id">广告投放推广</span>
                                        <span> <input type="checkbox" value="37" name="cat_id">文案策划</span>
                                        <span> <input type="checkbox" value="38" name="cat_id">设计</span>
                                        <span> <input type="checkbox" value="39" name="cat_id">图片后期</span>
                                        <span> <input type="checkbox" value="40" name="cat_id">起名取名</span>
                                        <span> <input type="checkbox" value="41" name="cat_id">翻译</span>
                                        <span> <input type="checkbox" value="42" name="cat_id">游戏</span>
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值