解决方法:
var x = target; var result = [] while (x.tagName != 'BODY') { console.info(x.className, x.className.indexOf("needsClick")) if(x.className.indexOf("needsClick")>0) { result.push(x); } x = x.parentNode; } if(result.length>0) return true;
本文共 386 字,大约阅读时间需要 1 分钟。
解决方法:
var x = target; var result = [] while (x.tagName != 'BODY') { console.info(x.className, x.className.indexOf("needsClick")) if(x.className.indexOf("needsClick")>0) { result.push(x); } x = x.parentNode; } if(result.length>0) return true;
转载于:https://www.cnblogs.com/qzccl/p/9534775.html