checkBox 获取选中的值

//获取角色的ID
function getRoleID(checkBoxName) {
    var selectRoleID = "";
    $("input[name='" + checkBoxName + "']").each(
                function() {
                    if ($(this).attr('checked') == true) {
                        selectRoleID += $(this).val() + ",";
                    }
                }
            );
    return selectRoleID;
}

 

$("input[type='checkbox']:checked").attr("value");

posted @ 2010-12-14 09:57  Kong, Star  阅读(423)  评论(0编辑  收藏  举报