11/26/2010

How to change value of input text by jquery

I was searching in the internet for this solution ,But I couldn't find the proper solution.But I tried it myself so I think to share with all.

First i have created one input text with id inputText by this html code .
<input type="text" id="inputText" value="1" />


Now I wrote the following code in jquery to change value 1 to 5

$(document).ready(function(){
$('#inputText').val('5');
}

No comments:

Post a Comment