zl程序教程

您现在的位置是:首页 >  后端

当前栏目

js获取子节点函数(兼容FF与IE)

JS节点 函数 获取 兼容 IE FF
2023-06-13 09:14:18 时间
复制代码代码如下:

functiongetFirstChild(obj){
varresult=obj.firstChild;
while(!result.tagName){
result=result.nextSibling;
}
returnresult;
}

functiongetNextChild(obj){
varresult=obj.nextSibling;
while(!result.tagName){
result=result.nextSibling;
}
returnresult;
}