Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

select onchange jquery get the selected option data attribute

$('#country').on('change', function(){
    let id = $(this).find(':selected').data('id');
    console.log(id);
  });
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #select #onchange #jquery #selected #option #data #attribute
ADD COMMENT
Topic
Name
6+9 =