Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Select a option of a select element with JQuery

<script>
  	$(document).ready(function() {
  		$("#status option[value='value']").attr("selected", true);
	});
</script>
Comment

selected select html jquery

<select id="menu">
   <option value="1">Opción 1</option>
   <option value="2">Opción 2</option>
   <option value="3">Opción 3</option>
</select>
<script >
  $(function () {
     $("#menu option[value='2']").attr("selected", true);
  });
</script>
Comment

jquery selected option

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

select option value jquery

$("select.country").change(function(){
  var selectedCountry = $(this).children("option:selected").val();
  alert("You have selected the country - " + selectedCountry);
});
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

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 redirect 
Javascript :: javascript redirect to another page 
Javascript :: javascript link to another page 
Javascript :: redirect react js 
Javascript :: window location redirect javascript 
Javascript :: redirect with javascript to another page 
Javascript :: pick random value from array 
Javascript :: javascript array distinct 
Javascript :: replace node 
Javascript :: jquery datepicker set default date 
Javascript :: regex for entire word 
Javascript :: javascript line break 
Javascript :: clear canvas 
Javascript :: javascript interview preparation 
Javascript :: get random letter js 
Javascript :: check overflow react 
Javascript :: how to write img jsx 
Javascript :: js absolute value 
Javascript :: ng build staging 
Javascript :: js not equal to null 
Javascript :: VM724:1 Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0 
Javascript :: vuex v-model 
Javascript :: JavaScript Using a Temporary Variable 
Javascript :: what is niceScroll 
Javascript :: javascript round number to nearest 5 
Javascript :: Uncaught Error: Incompatibile SockJS! Main site uses: "1.0.2", the iframe: "1.0.0". 
Javascript :: sequelize limit 
Javascript :: javascript stop delay 
Javascript :: javascript regex extract url from string 
Javascript :: rounding off in javascript 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =