descendants

descendants(element) -> [HTMLElement...]

返回 element 的所有后代节点,结果为一个数组,数组元素已经过 扩展

注意:所有 Prototype 的 DOM 扩展方法均忽略文本节点,仅返回元素节点。

样例

<div id="australopithecus">
	<div id="homo-herectus">
		<div id="homo-neanderthalensis"></div>
		<div id="homo-sapiens"></div>
	</div>
</div> 
$('australopithecus').descendants();
// -> [div#homo-herectus, div#homo-neanderthalensis, div#homo-sapiens] 
$('homo-sapiens').descendants(); 
// -> []