开发者

How to set Textbox value at page load?

开发者 https://www.devze.com 2023-03-06 20:13 出处:网络
I have to set asp.net TextBox’s value at page load using JQuery. Can somebody give me e开发者_如何学JAVAxample ?Try this

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/

0

精彩评论

暂无评论...
验证码 换一张
取 消