Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery get selected option value

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

jquery selected option

$( "#myselect 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

option selected jquery

$('select option[value=8272]').attr('selected', '');
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

jquery option selected

$('.selDiv option:eq(1)').prop('selected', true)
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

selected value jquery

$(this).val(); //in jquery it returns the selected value
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 empty cache and hard reload 
Javascript :: use local storage on server with node 
Javascript :: Javascript file in html angeben 
Javascript :: remove text javascript 
Javascript :: force page to reload on back button 
Javascript :: js select and copy on click 
Javascript :: nodemon package.json start 
Javascript :: how to get contrast from a color using js 
Javascript :: selecionar valselect2 js 
Javascript :: color console 
Javascript :: image onclick function react 
Javascript :: javascript distance math 
Javascript :: js check if function exists 
Javascript :: Custom jquery validation messages 
Javascript :: scrollto jquery 
Javascript :: send multiple files using formdata jquery 
Javascript :: react native width auto 
Javascript :: javascript backticks 
Javascript :: angular cli create component with module 
Javascript :: how to detect clicks with javascript 
Javascript :: how to get timestamp in javascript of a date object 
Javascript :: two decimal places in javascript 
Javascript :: copywithin javascript 
Javascript :: angular minutes to hour and minutes 
Javascript :: eslint unexpected console statement 
Javascript :: get element font size javascript 
Javascript :: dayjs timezone 
Javascript :: express limit based on ip 
Javascript :: random image and link js 
Javascript :: hashmap iteration javascirpt 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =