Ticket #8889 (closed bug: invalid)
Checkbox showing as checked in DOM but not on Screen
| Reported by: | anonymous | Owned by: | anonymous |
|---|---|---|---|
| Priority: | low | Milestone: | 1.next |
| Component: | attributes | Version: | 1.6b1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Screenshot http://i.imgur.com/ZYS8I.gif
This works in jQuery 1.5.2, but it fails in 1.6b1.
Change History
comment:1 Changed 2 years ago by addyosmani
- Owner set to anonymous
- Status changed from new to pending
comment:2 Changed 2 years ago by anonymous
- Status changed from pending to new
I (i.e. someone else) also have the problem.
I created a jsFiddle here (click the checkbox a few times): http://jsfiddle.net/6cKQw/ It worked before, not in 6b1.
I do not know how to test with the "jQuery (edge)" version. Perhaps this should be explained somewhere in the "how to file a bug" section :)
comment:3 Changed 2 years ago by timmywil
- Priority changed from undecided to low
- Resolution set to invalid
- Status changed from new to closed
- Component changed from unfiled to attributes
The checked attribute doesn't actually change and is not actually present in your fiddle. You are thinking of the property. You can use .prop("checked") or .is(":checked") to see if a checkbox is checked. The latter is preferable.
comment:4 Changed 2 years ago by qwertymk
http://jsfiddle.net/6cKQw/1/ should be what you want
comment:5 Changed 2 years ago by anonymous
Interesting, thank you. Stupid mistake on my part. But I had been using it since a year ago, across my entire application, most likely because I had read somewhere that I could do it like that. And that was in fact correct, at least until jQuery 1.5.2.
So I'm just making this last comment to prepare y'all for a bunch of people that may have partly broken applications as soon as 1.6 is released, if they automatically adopt it :) I realise that this is 'their fault', because they, like me, used a 'wrong' approach, but to them it may feel like something that's not backwards compatible. It's something that (erroneously) worked, but no longer does.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Thanks for taking the time to contribute to the jQuery project! Please provide a reduced test case on http://jsFiddle.net that reproduces the issue experienced to help us assess your ticket!
Additionally, test against the jQuery (edge) version to ensure the issue still exists.