You must Sign In to post a response.
  • Category: ASP.NET

    Please anybody help me to get textbox value using jquery

    How to get the value of a textbox control using jquery?
  • #763293

    Use below sample

    var val=$("#txtVal").Val();

    Give respect to your work, Instead of trying to impress your boss.

    Blog :

  • #763304
    You can use '#' selector to get textbox in JQuery
    see below snippet
    //to get value
    //to set value

    for more JQuery question I have already written an article on it can check beow link

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #763315
    you are trying to access the text box. So you have to provide the clientId or UniqueId

    $('#<%=txtEmpName.ClientID %>').val()

    By Nathan
    Direction is important than speed

  • #763323
    Hello Ranajoy,

    By using below code you can get the textbox value :

    var email = $("#txtEmail").val()

    By using below code you can set the textbox value :


    Hope you understand the logic. It is very simple.

    Nirav Lalan
    DNS Gold Member
    "Failure is the path of least persistence"

  • Sign In to post your comments