<html>
<body>
<INPUT NAME="first" VALUE="hello">
<script>
alert(document.all.first.value)
</script></body>
</html>

解决方案 »

  1.   

    考!怎么能那么写!你要是想alert()一个东西出来,起码得有一个事件来激发它吧???
    LOOK!!!
    <html>
    <body><html>
    <body onload=alert(document.all.first.value)>
    <script>
    </script>
    </body>
    </html><INPUT NAME="first" VALUE="hello">
    </body>
    </html>
      

  2.   

    script放到body之中,表示网页下载到此处时候执行,不需要再激发
      

  3.   

    <html>
    <body>
    <script>
    alert(document.all("first").value)
    </script>
    <INPUT NAME="first" VALUE="hello">
    </body>
    </html>
    无论是name还是id都可以用document.all
    所有的对象都在document.all这个里面找的到
    甚至可以用一个数字来表是document.all("4").value可能也可以啊
      

  4.   


    各位,这里用了HTML的嵌套。
    答案是:<html>
    <body><html>
    <body>
    <script for=window event=onload>
    alert(document.all.first.value)
    </script>
    </body>
    </html><INPUT NAME="first" VALUE="hello">
    </body>
    </html>