Count forms in a document : Form Info « Form Control « JavaScript DHTML






Count forms in a document

<html>

<body>
    <form name="Form1">
        Name: <input type="text" size="20">
    </form>
    <form name="Form2">
        Age: <input type="text" size="3">
    </form>

<script type="text/javascript">

    txt="This document contains: " + document.forms.length + " forms."
    document.write(txt)

</script>

</body>

</html>


           
       








Related examples in the same category

1.Formats, verifies and recover the contents of HTML forms
2.Access an item in a collection
3.Get form element infomation