- 时间:2020-07-30 19:29 编辑: 来源: 阅读:
- 扫一扫,手机访问
摘要:html的DOM中document对象forms集合用法实例
本文实例讲述了html的DOM中document对象forms集合用法。分享给大家供大家参考。具体分析如下:
forms 集合可返回对文档中所有 Form 对象的引用。
[b]语法:
[/b]
document.forms[]
[b]例子:
[/b]
<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>
希望本文所述对大家的javascript程序设计有所帮助。