Side navigation
#10627 closed bug (worksforme)
Opened November 01, 2011 07:46AM UTC
Closed November 01, 2011 02:40PM UTC
Last modified November 01, 2011 05:53PM UTC
since 1.6.3 , $("radio").attr("checked") alway return a string "checked"
| Reported by: | loohb@163.com | 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"
Attachments (0)
Change History (2)
Changed November 01, 2011 02:40PM UTC by comment:1
| component: | unfiled → attributes |
|---|---|
| priority: | undecided → low |
| resolution: | → worksforme |
| status: | new → closed |
Changed November 01, 2011 05:53PM UTC by comment:2
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.
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.