Returns true if one element is a child of the other

@author   Jelle De Loecker   <jelle@develry.be>
@since    1.2.2
@version  1.2.2

@param    {HTMLElement}   element

@return   {Boolean}
769830
function isChild(child, parent) {
	while (child = child.parentNode) {
		if (child == parent) {
			return true;
		}
	}

	return false;
}
954482
public static boolean hasChildsOf(final Element parentElement, XsdElementEnum child) {
        NodeList nodeList = parentElement.getChildNodes();
        for (int i = 0; i < nodeList.getLength(); i++) {
            final Node childNode = nodeList.item(i);
            if (childNode.getNodeType() == Node.ELEMENT_NODE) {
                final Element childElement = (Element) childNode;
                if (child.isTagNameEqual(childElement.getTagName())) {
                    return true;
                }

                if (childElement.hasChildNodes()) {
                    if (hasChildsOf(childElement, child)) {
                        return true;
                    }
                }
            }
        }
        return false;
    }
1114330
function (element) {
            var self = this;
            var $el = self.$el;    // 隐藏当然不包含了
            // 隐藏当然不包含了
            if (!self.get('visible') || !$el) {
                return false;
            }
            if ($el && ($el[0] === element || $el.contains(element))) {
                return true;
            }
            var children = self.get('children');
            for (var i = 0, count = children.length; i < count; i++) {
                var child = children[i];
                if (child.containsElement && child.containsElement(element)) {
                    return true;
                }
            }
            return false;
        }
495696
private Element getChildElement(Element parent) {
	NodeList list = parent.getChildNodes();
	int len = list.getLength();
	for (int i = 0; i < len; i++) {
	    Node node = list.item(i);
	    if (node instanceof Element) {
		return (Element) node;
	    }
	}
	return null;
    }
390924
function(node) {
            var parent = node.getParent();
            while(parent) {
                if(parent._id === this._id) {
                    return true;
                }
                parent = parent.getParent();
            }

            return false;
        }
1372927
public static void removeChildrenFrom(final Element element) {
        if (element != null) {
            while (element.getFirstChild() != null) {
                element.removeChild(element.getFirstChild());
            }
        }
    }
289315
public boolean isChildOf(GeometryIndex parentIndex, GeometryIndex childIndex) {
		if (parentIndex.getValue() != childIndex.getValue()) {
			return false;
		}
		if (parentIndex.hasChild() && childIndex.hasChild()) {
			return isChildOf(parentIndex.getChild(), childIndex.getChild());
		} else if (!parentIndex.hasChild() && childIndex.hasChild()) {
			return true;
		}
		return false;
	}
1308251
function scanChildren(element) {
        var found;
        if (element) {
          for (var i = 0, len = element.length; i < len; i++) {
            var target = element[i];
            if (!found) {
              for (var j = 0, numChild = target.childNodes.length; j < numChild; j++) {
                found = found || scanTree([target.childNodes[j]]);
              }
            }
          }
        }
        return found;
      }
457389
function (element) {
		element = element || this;
		while (element.firstChild && element.firstChild.parentNode) { element.firstChild.parentNode.removeChild(element.firstChild); }
	}
233626
function contains( element ) {
    for( var i = 0, len = lists.length; i < len; i++ ) {
      if( lists[i].element == element ) {
        return true;
      }
    }
    return false;
  }
1093655
def are_equal_elements(a_el, b_el):
    
    if a_el.tagName != b_el.tagName:
        return False
    if sorted(a_el.attributes.items()) != sorted(b_el.attributes.items()):
        return False
    if len(a_el.childNodes) != len(b_el.childNodes):
        return False
    for a_child_el, b_child_el in zip(a_el.childNodes, b_el.childNodes):
        if a_child_el.nodeType != b_child_el.nodeType:
            return False
        if (
            a_child_el.nodeType == a_child_el.TEXT_NODE
            and a_child_el.data != b_child_el.data
        ):
            return False
        if a_child_el.nodeType == a_child_el.ELEMENT_NODE and not are_equal_elements(
            a_child_el, b_child_el
        ):
            return False
    return True
761504
function (node) {
        var parent = node.parentNode;
        while (parent) {
            if (parent === this) {
                return true;
            }
            parent = parent.parentNode;
        }
        return false;
    }
983866
@Pure
	public boolean hasChild(N potentialChild) {
		if ((this.left == potentialChild) || (this.middle == potentialChild) || (this.right == potentialChild)) {
			return true;
		}
		return false;
	}
236161
def _is_node_an_element(self, node):
        
        # Try the simplest approach first, works for plain old ElementTree
        if isinstance(node, BaseET.Element):
            return True
        # For cElementTree we need to be more cunning (or find a better way)
        if hasattr(node, 'makeelement') and isinstance(node.tag, basestring):
            return True
577934
public boolean isAfter(T element) {
    if (element == null) { return false; }
    return comparator.compare(element, min) < 0;
  }
295932
public static boolean hasChildNode(Node parentNode, String nodeName){
                return getChildNode(parentNode, nodeName, null) != null ? true : false;
        }
5568
def is_child_of(self, node):
        
        return node.get_children().filter(pk=self.pk).exists()