Bug Tracker

Opened 6 years ago

Closed 6 years ago

#14009 closed bug (duplicate)

Unable to check a checkbox twice (1.10.1)

Reported by: siko Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.1
Keywords: Cc:
Blocked by: Blocking:

Description

Hi,

I have a very odd problem: I can check + uncheck a checkbox once, but not more!

Test:

<script type="text/javascript" src="jquery-1.10.1.min.js">
</script>
<input type="checkbox" id="test"/><label for="test">test</label>

I tried (all twice of course):

$('#test').attr('checked',true); $('#test').attr('checked',false);
$('#test').attr('checked','checked'); $('#test').removeAttr('checked');

It works once, but not more.

Tested on 1.10.1 and 1.9.1. Works perfectly on 1.4.4.

Tested on Chrome 27.0.1453.110 m & 21.0

Change History (3)

comment:1 Changed 6 years ago by siko

21.0 meant Firefox 21.0 of course.

comment:2 Changed 6 years ago by anonymous

And a jsFiddle as a demo:

http://jsfiddle.net/PmkCt/1/

comment:3 Changed 6 years ago by dmethvin

Resolution: duplicate
Status: newclosed

Duplicate of #13573.
Use .prop().

Note: See TracTickets for help on using tickets.