RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
HTMLHTMLCollection对象访问的三种方式
例:
  1. 通过getElementsByTagName:
    var form = document.getElementsByTagName('form')[0]
    console.log(form)
  2. 通过item(n):
    var form = document.forms.item(0)
    console.log(form)
  3. 通过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对象访问的三种方式
当前地址:http://sczitong.cn/article/pchsoh.html