日期:2014-05-16 浏览次数:20406 次
<html> <head> <script type="text/javascript"> function op() { var d = document.getElementById("form1"); var l = d.length; for(var i = 0; i < l-1; i++) { document.write(d.elements[i].name); } //document.write(d.elements[2].name); } </script> </head> <body> <form name="form1" action="3.html" method="post"> <input type="text" name="textfield" id="textfield"> <input type="text" name="textfield2" id="textfield2"> <input type="text" name="textfield3" id="textfield3"> <input type="text" name="textfield4" id="textfield4"> <input type="submit" name="button" id="button" value="提交" onclick="op()"> </form> </body> </html>