src/aria/utils/Dom.js
function (child, parent) {
            if (!(child && child.ownerDocument)) {
                return false;
            }
            var document = child.ownerDocument;
            var body = document.body;
            var element = child;
            while (element && element != body) {
                if (element == parent) {
                    return true;
                }
                element = element.parentNode;
            }
            return (element == parent); // can be true if parent == body and element is present in DOM
        }
function (child, parent) {
            if (!(child && child.ownerDocument)) {
                return false;
            }
            var document = child.ownerDocument;
            var body = document.body;
            var element = child;
            while (element && element != body) {
                if (element == parent) {
                    return true;
                }
                element = element.parentNode;
            }
            return (element == parent); // can be true if parent == body and element is present in DOM
        }
function ( child , parent ) { if ( ! ( child && child . ownerDocument ) ) { return false ; } var document = child . ownerDocument ; var body = document . body ; var element = child ; while ( element && element != body ) { if ( element == parent ) { return true ; } element = element . parentNode ; } return ( element == parent ) ; // can be true if parent == body and element is present in DOM }
Check whether a child element is a child element of a particular parentNode
@param {HTMLElement} child The child DOM element to check
@param {HTMLElement} parent The parent DOM element to check
@return {Boolean} True if the given child is a child of the given parent
Check whether a child element is a child element of a particular parentNode