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

时间:2025-05-15 16:35:44
  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);
}
}