- jquery 操作checkbox
- function checkAll()
- {
- $('input[type="checkbox"][name="item"]').attr("checked", true);
- // $('[name="item"]:checkbox').attr("checked", true);
- }
- function checkFootball()
- {
- $("[name='item']:checkbox").each(function() {
- if (this.value == 'football')
- {
- this.checked = true;
- }
- })
- }