遍历获取目标dom节点

function getReal(el, type, value) {
var temp = el;
while ((temp != null) && (temp.tagName != "BODY")) {
if (eval("temp." + type) == value) {
el = temp;
return el;
}
temp = temp.parentElement;
}
return el;
}
posted @ 2015-04-24 15:26  562323273  阅读(339)  评论(0编辑  收藏  举报