1.复选框全选全不选:
主复选框:
<td><input name="sids" type="checkbox" id="sids"></td>
其他小复选框:
<td><input name="ids" value="${item.id}" type="checkbox"></td>
实现代码:
$("#sids").click(function() {
var flag = document.getElementById("sids").checked;
$(":checkbox[name='ids']").attr("checked",flag);
})
2.路径跳转带参数:
location.href="${pageContext.request.contextPath }/item/itemList.action?code=" + code;
3.修改表单提交路径并提交:
$("#listForm").attr('action','${pageContext.request.contextPath }/item/deleteItem.action');
$("#listForm").submit();
4.获取选中的复选框的个数
var leng = $("input[type='checkbox']:checked").length;