How can i get the input element value in jquery
+3
A:
If this is your textbox
:
<input type="text" id="mytextBox" value="" />
You will be getting it's value
using the textbox's ID=mytextBox
...
var value = $("#mytextBox").val()
References
Garis Suero
2010-09-09 05:20:11
+2
A:
use jQuery('inputElement').val() to get the values of input(form) elements
sushil bharwani
2010-09-09 05:20:16
A:
The best way is to use the val()
function, as in:
$('#someInput').val();
You can also use the attr function to find the value for some fields
$('#someInput').attr('value');
Kranu
2010-09-09 05:33:28
+1
A:
The val
function gets or sets the value of an input field.
Set the input value to "Hello world":
$('#myInput').val('Hello world');
Get the input value:
$('#myInput').val();
Konal
2010-09-09 12:42:11