jquery select change event get selected option

Zulakis picture Zulakis · Oct 5, 2012 · Viewed 532.2k times · Source

I bound an event on the change event of my select elements with this:

$('select').on('change', '', function (e) {

});

How can I access the element which got selected when the change event occurs?

Answer

Naftali aka Neal picture Naftali aka Neal · Oct 5, 2012
$('select').on('change', function (e) {
    var optionSelected = $("option:selected", this);
    var valueSelected = this.value;
    ....
});