<html>
<head >
<title></title>
<script src="Scripts/jquery-2.1.1.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#btnSubmit").click(function(){
if ($("input:radio[name=Gender]").is(":checked")) {
var v = $("input:radio[name=Gender]:checked").val();
alert("Selected Gender:" + v);
}
else {
alert("Please select Gender");
}
return;
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<b>Select Gender:</b>
<br />
<input type="radio" id="rdbMale" value="Male" name="Gender" />
<label for="rdbMale">Male</label>
<input type="radio" id="rdbFemale" value="Female" name="Gender" />
<label for="rdbFeMale">FeMale</label>
<br />
<br />
<input type="button" id="btnSubmit" value="Submit" />
</div>
</form>
</body>
</html>
<head >
<title></title>
<script src="Scripts/jquery-2.1.1.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#btnSubmit").click(function(){
if ($("input:radio[name=Gender]").is(":checked")) {
var v = $("input:radio[name=Gender]:checked").val();
alert("Selected Gender:" + v);
}
else {
alert("Please select Gender");
}
return;
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<b>Select Gender:</b>
<br />
<input type="radio" id="rdbMale" value="Male" name="Gender" />
<label for="rdbMale">Male</label>
<input type="radio" id="rdbFemale" value="Female" name="Gender" />
<label for="rdbFeMale">FeMale</label>
<br />
<br />
<input type="button" id="btnSubmit" value="Submit" />
</div>
</form>
</body>
</html>
OUTPUT:
No comments:
Post a Comment