当前位置: 首页 > 网络学院 > 客户端脚本教程 > HTML DOM > HTML DOM forms 集合

HTML DOM
DOM TableRow 对象
DOM Textarea 对象
DOM Window 对象

HTML DOM forms 集合


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 450 ::
收藏到网摘: n/a

定义与用法

The forms collection returns a reference to all Form objects in the document.
forms 集合可用来返回文档中所有Form对象的参考

语法

document.forms[]


举例

<html>

<body>
<form name="Form1"></form>
<form name="Form2"></form>
<form name="Form3"></form>
<script type="text/javascript">

document.write("This document contains: ")
document.write(document.forms.length + " forms.")
</script>
</body>
</html>


尝试与演示

Count the number of forms in a document
计算文档中form的数量

Access an item in a collection
访问集合中的某个项目

评论 (0) All

登陆 | 还没注册?