Skip to main content

Bug Tracker

Side navigation

#10357 closed bug (wontfix)

Opened September 27, 2011 09:04PM UTC

Closed September 27, 2011 10:01PM UTC

remoteAttr("checked") destroys defaultChecked

Reported by: jakobdo@gmail.com Owned by:
Priority: low Milestone: None
Component: attributes Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:
Description

Hello,

i'm unsure if this is a bug, but when i have a checkbox:

<input type="checkbox" id="checkbox" name="checkbox" checked="checked" />

and uncheck the box with:

$("#checkbox").removeAttr("checked");

defaultChecked, is set to FALSE.

When done by js:

document.getElementById("checkbox").checked = false;

defaultChecked is still TRUE.

Is this a bug or just the way jquery is meant to be?

Attachments (0)
Change History (1)

Changed September 27, 2011 10:01PM UTC by timmywil comment:1

component: unfiledattributes
priority: undecidedlow
resolution: → wontfix
status: newclosed

Yes, this is intended behavior. We understand that boolean attributes correspond to their default properties, but in order to provide backwards compatibility (since the .attr() method worked primarily with properties prior to 1.6), we added a hook for booleans to give users the most commonly expected behavior. This may be deprecated and eventually removed in a future release.