代码示例:(标识:hdom_form_name)
<html>
<body>

<form id="myForm" method="get" name="myForm">
Name: <input type="text" size="20" value="Bill Gates" />
</form>

<script type="text/javascript">
document.write("Form name: ");
document.write(document.getElementById('myForm').name);
</script>

</body>
</html>
运行结果: