Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#10627 closed bug (worksforme)

since 1.6.3 , $("radio").attr("checked") alway return a string "checked"

Reported by: loohb@… Owned by:
Priority: low Milestone: None
Component: attributes Version: 1.6.4
Keywords: Cc:
Blocked by: Blocking:

Description

$("radio").attr("checked") alway return a string "checked"

Change History (2)

comment:1 Changed 7 years ago by addyosmani

Component: unfiledattributes
Priority: undecidedlow
Resolution: worksforme
Status: newclosed

Please see here for a test case that demonstrates the correct (and expected) behaviour with inputs of type 'radio' and 'checked': http://jsfiddle.net/EHjFa/. This isn't broken to the best of my knowledge.

comment:2 Changed 7 years ago by dmethvin

If you are trying to find the *currently* checked radio including any change that may have been made by the user, use $("radio").prop("checked") since .attr() represents the state in the HTML markup and is not changed by user actions.

Note: See TracTickets for help on using tickets.