I have to set asp.net TextBox’s value at page load using JQuery.
Can somebody give me example ?
3 Answers
Try this
<script type="text/javascript">
$(document).ready(function() {
$("#TextBox1").val("Hello World");
});
</script>
3 Comments
Tim
I have accepted his answer because he has given answer before any one else. All other answer is almost copy of his answer.
Abe Miessler
If you are using an HTML textbox this is the correct answer. If you were trying to do an ASP.NET textbox then this will not work.
Abe Miessler
For an ASP.NET TextBox that has the ID
TextBox1? <asp:TextBox ID="TextBox1" ....