I can get the element like this $("#txtEmail")
but I'm not sure how to get the actual value.
Jquery – How to get the value of a textbox using jQuery
jquery
Related Topic
- Javascript – jQuery get specific option tag text
- Javascript – How to get the children of the $(this) selector
- Javascript – How to know which radio button is selected via jQuery
- Javascript – How to check whether a checkbox is checked in jQuery
- Javascript – Get selected text from a drop-down list (select box) using jQuery
- Javascript – Scroll to an element with jQuery
- Javascript – How to return the response from an asynchronous call
Best Answer
There's a
.val()
method:If you've got an input with an id of
txtEmail
you can use the following code to access the value of the text box:You can also use the
val(string)
method to set that value: