Answers for "jquery check if select has option"

2

jquery find if select option exists

$("#yourSelect option[value='yourValue']").length > 0;
Posted by: Guest on June-16-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 "jquery check if select has option"

Code answers related to "Javascript"

Browse Popular Code Answers by Language