HTMLHTMLCollection对象访问的三种方式
例:
- 通过getElementsByTagName:
var form = document.getElementsByTagName('form')[0] console.log(form) - 通过item(n):
var form = document.forms.item(0) console.log(form) - 通过namedItem(name):
var form = document.forms.namedItem('lee') console.log(form)输出:
适用对象:
1、document.all 2、document.anchors 3、document.forms 4、document.images 5、document.links
名称栏目:HTMLHTMLCollection对象访问的三种方式
本文URL:http://www.scyingshan.cn/article/pchsoh.html


咨询
建站咨询
