I have to set asp.net TextBox’s value at page load using JQuery.
Can somebody give me e开发者_如何学JAVAxample ?Try this
<script type="text/javascript">
$(document).ready(function() {
$("#TextBox1").val("Hello World");
});
</script>
If it is an ASP.NET TextBox Try this:
<script type="text/javascript">
$(document).ready(function(){
$('#<%= tb_ASPTextBox.ClientID %>').val("my value");
});
</script>
You can use document.ready
Example http://fiddle.jshell.net/UB5L9/
精彩评论