首页>>表单>>jQuery SelectAllCheckbox 全选效果(2016-09-22)

jQuery SelectAllCheckbox 全选效果

jQuery SelectAllCheckbox 全选效果

 

XML/HTML Code
  1. <form name="myForm">  
  2.          <div id="container">  
  3.             <div id="checkboxes">  
  4.                <h3>Group 1 (indeterminate)</h3>  
  5.   
  6.                <label class="selectAllLabel">  
  7.                   <input type="checkbox" id="selectAllGroup1"/>  
  8.                   Select All  
  9.                </label>  
  10.   
  11.                <label>  
  12.                   <input type="checkbox" id="group1_a" name="group1" value="1a"/>  
  13.                   Choice A  
  14.                </label>  
  15.   
  16.                <label>  
  17.                   <input type="checkbox" id="group1_b" name="group1" value="1b"/>  
  18.                   Choice B  
  19.                </label>  
  20.   
  21.                <label>  
  22.                   <input type="checkbox" id="group1_c" name="group1" value="1c"/>  
  23.                   Choice C  
  24.                </label>  
  25.   
  26.                <h3>Group 2 (not indeterminate)</h3>  
  27.   
  28.                <label class="selectAllLabel">  
  29.                   <input type="checkbox" id="selectAllGroup2"/>  
  30.                   Select All  
  31.                </label>  
  32.   
  33.                <label>  
  34.                   <input type="checkbox" id="group2_a" name="group2" value="2a"/>  
  35.                   Choice A  
  36.                </label>  
  37.   
  38.                <label>  
  39.                   <input type="checkbox" id="group2_b" name="group2" value="2b"/>  
  40.                   Choice B  
  41.                </label>  
  42.   
  43.                <label>  
  44.                   <input type="checkbox" id="group2_c" name="group2" value="2c"/>  
  45.                   Choice C  
  46.                </label>  
  47.             </div>  
  48.   
  49.             <div id="log">  
  50.                Click something  
  51.             </div>  
  52.          </div>  
  53.       </form>  

 


原文地址:http://www.freejs.net/article_biaodan_586.html