lib/Ext/dom/Query.js
function (el, q) {
        var root, is, i, ln;

        if (typeof el == "string") {
            el = document.getElementById(el);
        }

        if (Ext.isArray(el)) {
            is = true;
            ln = el.length;
            for (i = 0; i < ln; i++) {
                if (!this.is(el[i], q)) {
                    is = false;
                    break;
                }
            }
        }
        else {
            root = el.parentNode;

            if (!root) {
                root = document.createDocumentFragment();
                root.appendChild(el);
                is = this.select(q, root).indexOf(el) !== -1;
                root.removeChild(el);
                root = null;
            } else {
                is = this.select(q, root).indexOf(el) !== -1;
            }
        }
        return is;
    }
function (el, q) {
        var root, is, i, ln;

        if (typeof el == "string") {
            el = document.getElementById(el);
        }

        if (Ext.isArray(el)) {
            is = true;
            ln = el.length;
            for (i = 0; i < ln; i++) {
                if (!this.is(el[i], q)) {
                    is = false;
                    break;
                }
            }
        }
        else {
            root = el.parentNode;

            if (!root) {
                root = document.createDocumentFragment();
                root.appendChild(el);
                is = this.select(q, root).indexOf(el) !== -1;
                root.removeChild(el);
                root = null;
            } else {
                is = this.select(q, root).indexOf(el) !== -1;
            }
        }
        return is;
    }
Returns true if the passed element(s) match the passed simple selector (e.g. div.some-class or span:first-child)
@param {String/HTMLElement/Array} el An element id, element or array of elements
@param {String} selector The simple selector to test
@return {Boolean}