Ticket #9856 (closed bug: worksforme)
Checkbox checked returning value or undefined in 1.6.2 not true or false.
|Reported by:||Glenn||Owned by:|
Recently upgraded from jQuery 1.4.4 to 1.6.2 and noticed (because code was breaking) that when you alert the value of $('#myID').attr('checked') if the checkbox was checked you get back 'checkbox'. If it was not checked you get back 'undefined'.
I checked other versions of jquery and this doesn't happen until the change from 1.5.2 -> 1.6.0, where the move to prop() made them both return 'undefined'.
1.6.1 is where we start seeing value or undefined returned. Shouldn't this be returning true or false if the goal is backwards compatibility?
Here is an example of the values in 1.5.2 http://jsfiddle.net/Gv3bW/
and in 1.6.2 http://jsfiddle.net/6R2df/
The code that would need to change to make them return true / false is in boolHooks.get, line 2402 of http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js.
return jQuery.prop( elem, name ) ? name.toLowerCase() : undefined;
return !!jQuery.prop( elem, name );
- Priority changed from undecided to low
- Resolution set to worksforme
- Status changed from new to closed
- Component changed from unfiled to attributes