Posted in Javascript onSeptember 21, 2013
window.GetAllChild = function (element, deep, condition) { if (!!!deep) { deep = 1; } if (!!!condition || condition == '') { condition = '1==1'; } deep--; if (!!!element || !!!element.childNodes || element.childNodes.length <= 0) { return []; } var result = new Array(); for (var i = 0; i < element.childNodes.length; i++) { if (element.style && (element.style.visibility == 'hidden' || element.style.display == 'none')) { continue; } var child = element.childNodes[i]; if (eval(condition)) { result.push(child); } if (deep > 0) { result = result.concat(GetAllChild(child, deep, condition)); } } return result; }
JS.GetAllChild(element,deep,condition)使用介绍
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@