how to get text box value in jQuery

Total Post:19

Points:133
JQuery 
 187  View(s)
Ratings:
Rate this:

how to get text box value in jQuery

  1. Post:140

    Points:984
    Re: how to get text box value in jQuery

    Value() in jquery :

    Use this .val() method: 

    If you've got an input with an id of #mindstick you can use the following code to access the value of the text box: 

    $("#Mindstick").val() 
    You can also use the val(string) method to set that value:
    $("#Mindstick").val("Software")

    or 

    Use this code for using class : 

    <input type="text" id="mindstick" class="textbox" value="1">
    $(document).ready(function(){
       alert($("#mindstick").val());
       alert($(".textbox").val());//Not recommended
    });

    Happy Coding :)

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!