#14202 closed bug (worksforme)
.prop('selected') does not select right option
Reported by: | anonymous | Owned by: | anonymous |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.10.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I hope I did not oversee this...
When using .prop('selected',true) on a select form field, the "selected" param is set, but the selected option is not shown as selected in the drop down. I have to set it using .val() in addition to make the select show up correctly.
FF 22 on Win7
Change History (6)
comment:1 Changed 9 years ago by
Owner: | set to anonymous |
---|---|
Status: | new → pending |
comment:2 Changed 9 years ago by
Status: | pending → new |
---|
jsFiddle does not have v1.10.2? Seems to work with 1.10.1.
comment:4 Changed 9 years ago by
ARGH I'm sorry, I'm not familiar with jsFiddle...
But you can see that it works with 1.10.1 (first fiddle).
comment:5 Changed 9 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
As long as you wait for the document to be ready, as you must, this works fine in both the 1.x and 2.x branches. If you don't wait, the selector selects nothing (it's not there yet) and therefore .prop()
has nothing to do.
Please provide a test case on jsFiddle, thanks!