jQuery SelectAllCheckbox 全选效果
XML/HTML Code
- <form name="myForm">
- <div id="container">
- <div id="checkboxes">
- <h3>Group 1 (indeterminate)</h3>
- <label class="selectAllLabel">
- <input type="checkbox" id="selectAllGroup1"/>
- Select All
- </label>
- <label>
- <input type="checkbox" id="group1_a" name="group1" value="1a"/>
- Choice A
- </label>
- <label>
- <input type="checkbox" id="group1_b" name="group1" value="1b"/>
- Choice B
- </label>
- <label>
- <input type="checkbox" id="group1_c" name="group1" value="1c"/>
- Choice C
- </label>
- <h3>Group 2 (not indeterminate)</h3>
- <label class="selectAllLabel">
- <input type="checkbox" id="selectAllGroup2"/>
- Select All
- </label>
- <label>
- <input type="checkbox" id="group2_a" name="group2" value="2a"/>
- Choice A
- </label>
- <label>
- <input type="checkbox" id="group2_b" name="group2" value="2b"/>
- Choice B
- </label>
- <label>
- <input type="checkbox" id="group2_c" name="group2" value="2c"/>
- Choice C
- </label>
- </div>
- <div id="log">
- Click something
- </div>
- </div>
- </form>
原文地址:http://www.freejs.net/article_biaodan_586.html