Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery get selected option value

$("select.your-select").change(function(){ 
	$(this).children("option:selected").val();
});
Comment

jquery get selected option value

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

select option value jquery

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

get selected option value jquery

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

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);
    });
Comment

jquery selected option value

 let payment_type = $("#olca_form_submit select[name='payment_type']")
      .find(":selected")
      .val();
Comment

get option value jquery

<select id="state">
    <option value="state1" data-id="1">state1</option>
    <option value="state2" data-id="2">state2</option>
    <option value="state3" data-id="3">state3</option>
</select>

$('#state option[data-id="2"]').val();

//output state2
Comment

jquery select option by value

$('.selDiv option[value="SEL1"]')
Comment

select selected option value jquery

var conceptName = $('#aioConceptName').find(":selected").text();
Comment

jquery select option value selected

$("div.id_100 select").val("val2").change();
Comment

select selected value jquery

If you want to get the selected option text, you can use $(select element). text() . var text = $('#aioConceptName option:selected'). text();
If you want to get selected option value, you can use $(select element). val() . var val = $('#aioConceptName option:selected').val();
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript time 
Javascript :: length of set javascript 
Javascript :: create url with query parameters javascript 
Javascript :: how to get a user input in js 
Javascript :: reset page js 
Javascript :: equivalent method load jquery with javascript 
Javascript :: how to set empty date in javascript 
Javascript :: cart page route in shopify 
Javascript :: what is functional composition 
Javascript :: create a loop that runs through each item in an array 
Javascript :: js iso date split 
Javascript :: javascript compare two arrays of objects 
Javascript :: search datatable vuetify 
Javascript :: jasmine spy return value when using create Spy Object angular 2 
Javascript :: react native safeareaview 
Javascript :: find js 
Javascript :: mongo mongoose join aggregation lookup 
Javascript :: react-native-config 
Javascript :: slice method in js 
Javascript :: placing card on center in angular flex layout 
Javascript :: js loop through object keys 
Javascript :: reverse array javascript 
Javascript :: how to redirect in react router v6 
Javascript :: substr() javascript 
Javascript :: append line break javascript 
Javascript :: js get words first letter 
Javascript :: npm fs 
Javascript :: how to remove last index of array in javascript 
Javascript :: javascript delay action 
Javascript :: js combine arrays 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =