Opened 15 years ago
Closed 13 years ago
#4049 closed bug (duplicate)
Cannot set checkboxes in strict XHTML
Reported by: | gglockner | Owned by: | john |
---|---|---|---|
Priority: | major | Milestone: | 1.3.2 |
Component: | data | Version: | 1.3.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Suppose you have a strict XHTML page in jQuery 1.3.1, and suppose the DOM contains a checkbox. If you try to set the state of the checkbox via $("#c").attr("checked","checked") or clear it with $("#c").removeAttr("checked"), the state of the checkbox is not affected.
This affects Webkit and Firefox.
A detailed example can be found at:
http://groups.google.com/group/jquery-dev/browse_thread/thread/df977021a6357ff3/
Attachments (1)
Change History (8)
comment:1 Changed 15 years ago by
comment:2 follow-up: 3 Changed 15 years ago by
Owner: | set to john |
---|
It sounds like this may be related to XML detection in Sizzle? See also #4054.
comment:3 Changed 15 years ago by
comment:4 Changed 15 years ago by
This is directly related to http://dev.jquery.com/ticket/4283 (and is basically the same bug)
comment:5 Changed 15 years ago by
I've uploaded a temporary fix by proxying attr and remoteAttr. It's not an ideal solution or fix. But for folks with the server sending application-xhtml+xml content type correctly, this will work.
comment:6 Changed 14 years ago by
I think this is another property-vs-attribute issue. The browser determines the initial value of the checked property by looking at the checked attribute. The checked property controls whether the box is checked or not.
comment:7 Changed 13 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Dup of #4283 which has more discussion.
Clarification: if the user clicks on the checkbox first, then jQuery is unable to change the state of the checkbox.