how to get selected option attribute value in jquery code example
Example 1: get selected option value
var conceptName = $('#aioConceptName').find(":selected").val();
Example 2: selected option attribute jquery
$('#location').find('option:selected').attr('myTag');
Example 3: get selected option value jquery
$("#vacc_wellness_agegroups option:selected").val();
Example 4: jquery dropdown selected value show field
jQuery(document).ready(function() {
jQuery("#carm3").change(function() {
if (jQuery(this).val() === 'other'){
jQuery('input[name=other_interest]').show();
} else {
jQuery('input[name=other_interest]').hide();
}
});
});
Example 5: get attribute of selected option jquery
var option = $('option:selected', this).attr('mytag');