jquery获取所有选中的checkbox的ID

 

 

    //获取所有选中的CheckBox的id
    function getCheckBox() {
        var spCodesTemp = "";
        $("input:checkbox[name=IsOnSell]:checked'").each(function(i) {
            if (0 == i) {
                spCodesTemp = $(this).attr("id");
            } else {
                spCodesTemp += ("," + $(this).attr("id"));
            }
        });
        alert(spCodesTemp);
    }

 

posted on 2013-11-28 15:18  alonelonly  阅读(1836)  评论(0编辑  收藏  举报

导航