确定文档中的表单数量

  1. <html>
  2. <body>
  3.  
  4. <form name="Form1"></form>
  5. <form name="Form2"></form>
  6. <form name="Form3"></form>
  7.  
  8. <script type="text/javascript">
  9. document.write("文档包含: " + document.forms.length + " 个表单。")
  10. </script>
  11.  
  12. </body>
  13. </html>