Search code examples
jqueryevents

jQuery select change event get selected option


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?


Solution

  • $('select').on('change', function (e) {
        var optionSelected = $("option:selected", this);
        var valueSelected = this.value;
        ....
    });