We are providing online training of realtime Live project on Asp.Net MVC with Angular and Web API. For more information click here. If you have any query then drop the messase in CONTACT FORM

Wednesday, July 15, 2015

Radio button Example2 in jquery

<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: