首页 技术教程 实用代码 注册破解 正则表达式 网址导航 电子书籍

Prototype实战教程:Element.Methods -> descendantOf

descendantOf descendantOf(element, ancestor) -> Boolean 判断 element 是否是参数 ancestor 指定元素的后代节点。 因为 Element.descendantOf 内部对 ancestor 应用了 $(),所以参数 ancestor 既可以是元素,也可以是元素的 ID。 样例 <div id="australopithecus"> <div id="homo-herectus"> <div id="homo-sapiens"></div> </div> </div> $('homo-sapiens').descendantOf('australopithecus'); // -> true $('homo-herectus').descendantOf('homo-sapiens'); // -> false ...
类别:网页编程 - JavaScript    查看:108    更新:2014-05-22

Prototype实战教程:Element -> descendantOf

descendantOf(element, ancestor) -> Boolean 判断 element 是否是参数 ancestor 指定元素的后代节点。 因为 Element.descendantOf 内部对 ancestor 应用了 $(),所以参数 ancestor 既可以是元素,也可以是元素的 ID。 样例 <div id="australopithecus"> <div id="homo-herectus"> <div id="homo-sapiens"></div> </div> </div> $('homo-sapiens').descendantOf('australopithecus'); // -> true $('homo-herectus').descendantOf('homo-sapiens'); // -> false ...
类别:网页编程 - JavaScript    查看:123    更新:2014-05-22