在页面打开时 就在js中给 text框赋值

解决方案 »

  1.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html">
    <title>JavaScript</title><script  type="text/javascript">function f(){
    document.getElementById("textbox").value='aaaaaaaa';
    }</script></head>
    <body onload="f()">
    <input type="text" id="textbox"/></body>
    </html> 
      

  2.   

    你直接在TEXT框里VALUE="内容" 不就得了
      

  3.   


    <script> 
    window.onload   =   function()   { 
            document.getElementById("textbox").value='val';

    </script> 这可以 。
      

  4.   

    同理,如果采用jquery的话,可以
    $(document).ready(){$("#textbox").val(value);
    }