HTML DOM forms 集合
定義和用法
forms 集合可返回對文檔中所有 Form 對象的引用。
語法
document.forms[]
實例
<html> <body> <form name="Form1"></form> <form name="Form2"></form> <form name="Form3"></form> <script type="text/javascript"> document.write("This document contains: ") document.write(document.forms.length + " forms.") </script> </body> </html>