How To Get TextBox Value Using Button Click In Jquery

In this article i explain you how to get textbox value in jquery
Add jquery refereces to your code
Step1:-
 <script type="text/javascript">
        $(document).ready(function () {  
   
            $('#btnSubmit').click(function () {
                var Name = $('#TextBox1').val();
                $('#Label1').html(Name);
            });
          });
    </script>
Step2:- Wreite source code
 <b>Enter Name : </b> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <br />
            <asp:Button ID="btnSubmit" runat="server" Text="Submit" />
            <br />
            <asp:Label ID="Label1" runat="server"></asp:Label>
Output:-

No comments:

Post a Comment