length 属性可设置或返回表单的名称。
formObject.name=formname
下面的例子可返回表单的名称:
<html>
<body>
<form id="myForm" method="get" name="myForm">
Name: <input type="text" size="20" value="Peter Griffin" />
</form>
<script type="text/javascript">
document.write("Form name: ");
document.write(document.getElementById('myForm').name
);
</script>
</body>
</html>