文章浏览阅读75次。获取节点getElementById() 根据id获取dom对象,如果id重复,那么以第一个为准//按照id获取function testById(){ var p = document.getElementById("p1"); console.log(p);}getElementsByTagName() 根据标签名获取dom对象数组//按照标签名获取function testByTagName(){ var inputs = document.ge_chilrden childnodes