Bug Tracker

Opened 6 years ago

Closed 6 years ago

#14437 closed bug (duplicate)

jq1.10.2 click点击的问题

Reported by: 18210606014@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:

Description

我不知道怎么上传图片.而且我的英文真的很差,所以只能复制到这里了 html代码: <legend>个人基本信息</legend>

<input type="checkbox" name="items" id="" value="足球"/>足球 <input type="checkbox" name="items" id="" value="篮球"/>篮球 <input type="checkbox" name="items" id="" value="羽毛球"/>羽毛球 <input type="checkbox" name="items" id="" value="乒乓球"/>乒乓球 <input type="checkbox" name="items" id="" value="网球"/>网球 <br /> <input type="checkbox" name="" id="CheckAll" />全选/全不选 <input type="button" value="提交" id="send" />

js代码部分 $(document).ready(function() {

$('#CheckAll').click(function(event) {

$('[name=items]:checkbox').attr('checked',this.checked);

});

});

我希望他可以在点击的时候全选,再点击则全不选,但是情况是第一次点击全选,第二次点击全不选,都很正常,但是在以后的点击里,则都是全不选的状态。

Change History (1)

comment:1 Changed 6 years ago by gibson042

Resolution: duplicate
Status: newclosed

Duplicate of #13245.

Note: See TracTickets for help on using tickets.