js搜索相同类型的控件全选、取值(Checkbox)

  function selectAll(obj) {
            if (obj.checked) {
                $("input[type='checkbox']").each(function () { $(this).attr('checked', 'checked'); });
            } else {
                $("input[type='checkbox']").each(function () { $(this).removeAttr('checked'); });
            }
        }
 function searchPoint() {
             var currentPoints = "";
            $("input[name='r1']").each(function () { if ($(this).attr('checked')) { currentPoints += $(this).val() + "@"; } });
            if (currentPoints != "") {
                currentPoints = currentPoints.substring(0, currentPoints.length - 1);
            }
        }
原文地址:https://www.cnblogs.com/yisheng/p/3373399.html