Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jqury get selected option


<select id="myselect">
    <option value="1">Mr</option>
    <option value="2">Mrs</option>
    <option value="3">Ms</option>
    <option value="4">Dr</option>
    <option value="5">Prof</option>
</select>

<script>
$( "#myselect option:selected" ).val();
</script>
Comment

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

get selected option value jquery

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

Jquery get value of dropdown selected

var conceptName = $('#aioConceptName').find(":selected").text();
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 find selected option in select

$('#dropdown').on('change', function() {
  var selected_option_value = $(this).find(":selected").val();
});
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

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 :: fetch api post req 
Javascript :: react fontawesome 
Javascript :: npx: Create react chrome extension 
Javascript :: change header background color on scroll css 
Javascript :: pass array of strings to match in str.replace 
Javascript :: update node js mac to latest version 
Javascript :: pdf dark 
Javascript :: javascript is variable a string 
Javascript :: Math prime js 
Javascript :: Finding the array element: 
Javascript :: bootstrap modal popup disable click outside 
Javascript :: tab navigation react-native without title 
Javascript :: replace all spaces with dash in javascript 
Javascript :: npx create react app Must use import to load ES Module error 
Javascript :: node http post 
Javascript :: how to get data from another website in javascript 
Javascript :: js character certain count 
Javascript :: javascript get all keys of object 
Javascript :: how to concurrently run angular and node 
Javascript :: javascript array insert at 0 
Javascript :: javascript check if not null 
Javascript :: require() of ES modules is not supported when importing node-fetch 
Javascript :: react map key increment 
Javascript :: prevent form from reloading with preventDefault 
Javascript :: adonis attach 
Javascript :: vue timeout 
Javascript :: javascript object total 
Javascript :: javascript link to another page 
Javascript :: vehicle number formik validation 
Javascript :: node redirection 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =