The below code snippet explains how to get the value of the option from HTML Select dropdown using jQuery
<select id="mySelect">
<option value="1">Yes</option>
<option value="2">No</option>
</select>
<input type="button" id="demo" value = "Demo" />
<script type="text/javascript">
$("#demo").live("click", function () {
//Get value of the selected option
var selectedValue = $("#mySelect option:selected").val();
alert(selectedValue);
});
</script>
Explanation:
The button with ID demo is attached with a click event. When the button is clicked the value of the selected option of the HTML Select Dropdown with ID mySelect is fetched and displayed in alert.