jquery get option value code example

Example 1: jquery get selected option value

var selectedOptionText = $('#mySelectID').find(":selected").text();//selected option text
var selectedOptionVal = $('#mySelectID').find(":selected").val();//selected option value

Example 2: jquery selected option text

$("#mySelect option:selected").html();

Example 3: get selected option value jquery

$("#vacc_wellness_agegroups option:selected").val();

Example 4: jquery selected option value

$(document).ready(function(){
    $("select.country").change(function(){
        var selectedCountry = $(this).children("option:selected").val();
        alert("You have selected the country - " + selectedCountry);
    });

Example 5: jquery get selected option value

jquery get selected option value