放在一个函数中,<body onload="f()">

解决方案 »

  1.   

    function aaa(){
    var temptemp=document.forms[0].refer.value;
    if (temptemp=="1")
    {
      document.getElementById("button1").style.display="";
      document.getElementById("button2").style.display="none";
    }
    else
    {
      document.getElementById("button1").style.display="none";
      document.getElementById("button2").style.display="";
    }
    }.....
    <body onload="aaa();">
    ...
    </body>
      

  2.   

    直接放到網頁的最後或者寫程function然後調用,最好就用ONLOAD=FUNCTIONNAME()
      

  3.   

    那些通过CTRL+ENTER提交又是什么写的?
      

  4.   

    to mykenny(不要问我从哪里来,我的故乡在广州(№…非典啊…)!) onkeydown="if(event.keyCode==13&&event.ctrlKey)form1.submit()"
      

  5.   

    onkeydown="if(event.keyCode==13&&event.ctrlKey)form1.submit()"
    应该写在什么地方呢?