Bug Tracker

Opened 8 years ago

Closed 8 years ago

#10357 closed bug (wontfix)

remoteAttr("checked") destroys defaultChecked

Reported by: jakobdo@… 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?

Change History (1)

comment:1 Changed 8 years ago by timmywil

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.

Note: See TracTickets for help on using tickets.