From d10aad7bfad2699e87d9bac3a8df48e71ea4dd20 Mon Sep 17 00:00:00 2001 From: tjcrowder Date: Fri, 9 Oct 2009 17:15:15 +0100 Subject: [PATCH] doc: Merged/updated old docs for Element.descendantOf. --- src/dom/dom.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/dom/dom.js b/src/dom/dom.js index 84c144d..d68b232 100644 --- a/src/dom/dom.js +++ b/src/dom/dom.js @@ -922,8 +922,28 @@ Element.Methods = { /** * Element.descendantOf(@element, ancestor) -> Boolean + * - ancestor (Element | String): The element to check against (or its ID). * * Checks if `element` is a descendant of `ancestor`. + * + * ##### Example + * + * Assuming: + * + * language: html + *
+ *
+ *
+ *
+ *
+ * + * Then: + * + * $('homo-sapiens').descendantOf('australopithecus'); + * // -> true + * + * $('homo-erectus').descendantOf('homo-sapiens'); + * // -> false **/ descendantOf: function(element, ancestor) { element = $(element), ancestor = $(ancestor);