全选 function checkAll() { var checkedOfAll=$("#selectAll").prop("checked"); alert(checkedOfAll); $("input[name='procheck']").prop("checked", checkedOfAll); }
全选 function checkAll() { var checkedOfAll=$("#selectAll").attr("checked"); alert(checkedOfAll); $("input[name='procheck']").attr("checked", checkedOfAll); }
总结,如果使用jquery,应使用prop方法来获取和设置checked属性,不应使用attr.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn