<html> <body> <form id="myForm" method="get" name="myForm"> 名字:<input type="text" size="20" value="RuanChen" /> </form> <script type="text/javascript"> document.write("表单名称: "); document.write(document.getElementById('myForm').name); </script> </body> </html>
编辑上面的文字,按下“查看结果”,效果会显示在右边 Create by 软晨网(RuanChen.com)