on select change get value jquery code example
Example 1: .on change get value
$('select').on('change', function() {
alert( this.value );
});
Example 2: select onchange jquery get the selected option data attribute
$('#country').on('change', function(){
let id = $(this).find(':selected').data('id');
console.log(id);
});
Example 3: jQuery change select value
$("#mySelectElementID").val("my_new_value"); //change selected option/value with jQuery