使用jquery切换所有复选框

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用jquery切换所有复选框相关的知识,希望对你有一定的参考价值。

  1. <script>
  2.  
  3. jQuery(document).ready(function() {
  4. jQuery("#selectall").click(function()
  5. {
  6. var checked_status = this.checked;
  7. jQuery("input[type='checkbox']").each(function()
  8. {
  9. this.checked = checked_status;
  10. });
  11. });
  12. });
  13. </script>

以上是关于使用jquery切换所有复选框的主要内容,如果未能解决你的问题,请参考以下文章