// 循环获取radio的值
循环获取checkbox的值
判断checkbox是否选中
获取select的值
var level_important = 0;
var list = $("input[type='radio'][name='" + ("radio_level_important_" + id)
+ "']");
list.each(function() {
if ($(this).attr('checked') == "checked") {
level_important = $(this).val();
}
});
level_important = level_important == 0 ? 2 : level_important;
循环获取checkbox的值
// 删除按钮单击事件
$("#delete").click(function() {
var ids = "";
var list = $("input[type='checkbox'][name='ids']");
list.each(function() {
if ($(this).attr('checked') == "checked") {
ids += $(this).val() + ",";
}
});
if ($.trim(ids)) {
ids = ids.substring(0, ids.length - 1);
if (confirm("确定要删除所选择的项次吗?")) {
location.href = "department!deleteBatch.action?department.code="
+ ids;
}
} else {
alert("请选择所要操作的项次!");
}
});
判断checkbox是否选中
var report_status = $("#chk_report_status_" + id).attr('checked')
? "Y"
: "N";
获取select的值
var categories_belong = $("#categories_belong_" + id).val();
or
var categories_belong = $("#categories_belong_" + id).text();