Reputation: 43
I have to set asp.net TextBox’s value at page load using JQuery.
Can somebody give me example ?
Upvotes: 4
Views: 20638
Reputation: 85056
If it is an ASP.NET TextBox Try this:
<script type="text/javascript">
$(document).ready(function(){
$('#<%= tb_ASPTextBox.ClientID %>').val("my value");
});
</script>
Upvotes: 2
Reputation: 68912
You can use document.ready
Example http://fiddle.jshell.net/UB5L9/
Upvotes: 0
Reputation: 22076
Try this
<script type="text/javascript">
$(document).ready(function() {
$("#TextBox1").val("Hello World");
});
</script>
Upvotes: 3