Get the selected value when changing the selected value with jQuery -


I think that when I have selected a value in a dropdown, the value is chosen.

Any thoughts?

Thanks,

Try something like this: < Pre> $ (document) .ready (function () {$ ('# your_select'). Change (function () {var result = $ (this) .val (); do_something_with (results);}); });

Consuming HTML in this way:

  & lt; Select ID = "your_select" name = "selectname" & gt; & Lt; Option value = "foo" & gt; Foo! & Lt; / Options & gt; & Lt; Option value = "bar" & gt; times! & Lt; / Options & gt; & Lt; / Select & gt;    

Comments