<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/jquery-2.1.1.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("input:radio[name=Options]").change(function () {
var v = $("label[for=" + $(this).prop("id") + "]").text();
// alert("Selected Options
is:" + v);
$("#lbl1").html("selected
option is: " + v);
});
});
</script>
</head>
<body>
<form id="form2" runat="server">
<div>
<b>Select Options</b>
<br />
<asp:RadioButton ID="rdb1" runat="server" Text="Option1" GroupName="Options" />
<asp:RadioButton ID="rdb2" runat="server" Text="Option2" GroupName="Options" />
<br />
<asp:Label ID="lbl1" runat="server" />
</div>
</form>
</body>
</html>
Output:
No comments:
Post a Comment