user1048676
user1048676

Reputation: 10066

Get Option Value of changed Select

All, I have multiple selects on my page all with the same class. The class is called event_selection. Whenever someone changes one of these selects I'd like to get the selected option value with jQuery.

How can I go about doing that?

Thanks!

Upvotes: 0

Views: 385

Answers (2)

thecodeparadox
thecodeparadox

Reputation: 87073

$('.event_selection').on('change', function() { // bind change event
  // get the value
  alert( this.value );  // or $(this).val(), but previous one is faster
});

Upvotes: 1

Johan
Johan

Reputation: 35194

$('.event_selection').change(function(){
    alert($(this).val());
});

This thread is possibly a duplicate of 500 others though...

Upvotes: 1

Related Questions