HTML DOM length Property
Complete Form Object Reference
Definition and Usage
The length property returns the number of elements in a form.
Syntax
Example
The following example returns the number of elements in the form:
<html>
<body>
<form id="myForm" method="get">
Name: <input type="text" size="20" value="Peter Griffin" /><br />
Text: <input type="text" size="20" value="Hello World" />
</form>
<script type="text/javascript">
document.write("Number of elements in myForm: ");
document.write(document.getElementById('myForm').length);
</script>
</body>
</html>
|
Try-It-Yourself Demos
Get the
number of elements in a form
Complete Form Object Reference
Whether you're new to XML or already an advanced user, the user-friendly views
and powerful entry helpers, wizards, and debuggers in XMLSpy are designed to
meet your XML and Web services development needs from start to finish.
- XML editor
- Graphical XML Schema / DTD editors
- XSLT 1.0/2.0 editor, debugger, profiler
- XQuery editor, debugger, profiler
- Support for Office Open XML (OOXML)
- Graphical WSDL editor & SOAP debugger
- Java, C#, C++ code generation
- And much more!
Download a fully functional free 30-day trial today!
|