查找节点

1.document.getElementById              返回值:element / null

  根据ID查找元素                       

2.document.getElementByName        返回值:集合

  根据name查找节点对象             

3.document.getElementByTagName      返回值:集合

  根据标签名查找节点对象,能被document和节点对象调用,

  document.getElemetsByTagName : 在全局中查找元素

  node.getElementsByTagName:在指定节点下查找元素

4.document.getElementsByClassName      返回值:集合   

   根据类名查找节点对象

         

猜你喜欢

转载自blog.csdn.net/weixin_43076899/article/details/82659700