document.forms.length : forms « Document « JavaScript Tutorial






The length property contains the number of Form objects that are in the forms[] array.

<html>
    <form name="Form1">
      <input type="button"
             value="Green"
             onClick = "document.bgColor='green'">
    </form>
    <form name="Form2">
      <input type="button"
             value="Blue"
             onClick = "document.bgColor='blue'">
    </form>
    <script language="JavaScript">
    <!--

    document.write(document.forms.length," Form objects in document.");

    -->
    </script>
    </html>








14.13.forms
14.13.1.document.forms
14.13.2.document.forms.length
14.13.3.The Form Array