Answers for "how to get value from select option using input name 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
0

jquery: get selected option of the drop down list

$('#ddlID').val();
$('#ddlID').text();
Posted by: Guest on June-28-2020
0

how to get value from select option using input name in jquery

document.getElementById('prod_addcart21').addEventListener('click', function () {
		if ($('select[name="variation[1]"]').val() == '') {
				alert('Please, choose an option 1');
			return false;
		} else if ($('select[name="variation[2]"]').val() == '') {
	
			alert('Please, choose an option 2');



		} else if ($('select[name="variation[3]"]').val() == '') {

			alert('Please, choose an option 3');


		} else {
			alert("product added to cart")
		}
	

	});
Posted by: Guest on October-02-2021

Code answers related to "how to get value from select option using input name in jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language