`

jquery 操作checkbox 全选

 
阅读更多
  1. jquery 操作checkbox
  2. function checkAll()   
  3. {   
  4.    $('input[type="checkbox"][name="item"]').attr("checked"true);   
  5.                        
  6.    // $('[name="item"]:checkbox').attr("checked", true);   
  7. }  
Js代码  
  1. function checkFootball()   
  2. {   
  3.    $("[name='item']:checkbox").each(function() {   
  4.        if (this.value == 'football')   
  5.        {   
  6.           this.checked = true;   
  7.        }   
  8.    })      
  9. }  
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics