How can I get the value of an input element in jQuery?
You can set a common class for your textbox inside grid and then using class you can get text box id and it's value. here i have just given an example. it's not in grid but it should work for gridview too.
Answer: Use the jQuery . attr() Method attr() method to dynamically set or change the value of href attribute of a link or anchor tag. This method can also be used to get the value of any attribute.
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()
$("#elementId").val()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With