js获取子节点函数(兼容FF与IE)_表单特效
时间:2021-07-01 10:21:17
帮助过:10人阅读
代码如下:
function getFirstChild(obj) {
var result = obj.firstChild;
while (!result.tagName) {
result = result.nextSibling;
}
return result;
}
function getNextChild(obj) {
var result = obj.nextSibling;
while (!result.tagName) {
result = result.nextSibling;
}
return result;
}