how to get data select field code example
Example: select onchange jquery get the selected option data attribute
$('#country').on('change', function(){
let id = $(this).find(':selected').data('id');
console.log(id);
});
$('#country').on('change', function(){
let id = $(this).find(':selected').data('id');
console.log(id);
});