Skip to main content

Bug Tracker

Side navigation

#10248 closed bug (invalid)

Opened September 10, 2011 07:14PM UTC

Closed September 10, 2011 07:22PM UTC

Checkbox attribute "checked" error

Reported by: anonymous Owned by:
Priority: low Milestone: None
Component: attributes Version: 1.6.3
Keywords: Cc:
Blocked by: Blocking:
Description

Hello

here is a simple game

http://jsfiddle.net/X6XnV/

when you press 1-3-1

it should uncheck 2 and check 3 and its work properly in 1.5.2

but not work in 1.6

Attachments (0)
Change History (1)

Changed September 10, 2011 07:22PM UTC by timmywil comment:1

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

.attr("checked", "") will set the checked attribute to empty string, which is still true. The mere presence of the checked attribute indicates that it is true. It was a mistake that this set the checked property to empty string in versions of jQuery prior to 1.6, which in a roundabout way got treated as false. This is one reason why it was always recommended to use .removeAttr('checked') instead. Nevertheless, the recommended way to set the checked property to false is

.prop('checked', false)