Skip to content

:selected does not pick up changes if used as selector #86

@acdcjunior

Description

@acdcjunior

Update:

Instead of using

  • $("#mySelector:selected") or
  • $("#mySelector:checked")

Use

  • $("#mySelector").filter(":selected") or
  • $("#mySelector").filter(":checked")

Using $("...").is(":selected") or $("...").is(":checked") works fine as well.


Reason:
If you change the selected <option>, the :selected selector still brings the initially selected one.

http://jsbin.com/nematiteba/1/edit?html,js,output

:checked has problems as well.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions