Answers for "how to check select option value in jquery"

8

select option value jquery

$("select.country").change(function(){
  var selectedCountry = $(this).children("option:selected").val();
  alert("You have selected the country - " + selectedCountry);
});
Posted by: Guest on February-19-2020
1

jquery check if select option is selected

$(document).ready(function(){
	
	$(".yes").hide();
	$(".no").hide();

	$("#existing-subscriber").change(function(){
	
		if ( $(this).val() == "Yes" ) { 
			$(".yes").show();
			$(".no").hide();
        }
        if( $(this).val() == "No" ) { 
			$(".no").show();
			$(".yes").hide();
        }
     
    }); 
	
});
Posted by: Guest on April-14-2021

Code answers related to "how to check select option value in jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language