<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>jQuery Get Selected Option Value hemant9807</title>
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("select.country").change(function() {
var selectedCountry = $(".country option:selected").val();
alert("You have selected the country - " + selectedCountry);
});
});
</script>
</head>
<body>
<form>
<label>Select Country:</label>
<select class="country">
<option value="china">china</option>
<option value="india">India</option>
</select>
</form>
</body>
</html>
Hi Hemant, I can see dropdown alone. I don't see alert SMS as you said above
ReplyDeletehello brother this code is properly working.
Delete