src/aria/utils/Mouse.js
function findByAttribute (start, attribute, maxDepth, stopper) {
        var target = start, expandoValue;

        while (maxDepth && target && target != stopper) {
            if (target.attributes) {
                var expandoValue = target.attributes[attribute];
                if (expandoValue) {
                    return expandoValue.nodeValue;
                }
            }
            target = target.parentNode;
            maxDepth--;
        }
    }
function findByAttribute (start, attribute, maxDepth, stopper) {
        var target = start, expandoValue;

        while (maxDepth && target && target != stopper) {
            if (target.attributes) {
                var expandoValue = target.attributes[attribute];
                if (expandoValue) {
                    return expandoValue.nodeValue;
                }
            }
            target = target.parentNode;
            maxDepth--;
        }
    }
function findByAttribute ( start , attribute , maxDepth , stopper ) { var target = start , expandoValue ; while ( maxDepth && target && target != stopper ) { if ( target . attributes ) { var expandoValue = target . attributes [ attribute ] ; if ( expandoValue ) { return expandoValue . nodeValue ; } } target = target . parentNode ; maxDepth -- ; } }
Find the first parent of 'start' element with the attribute specified by 'attribute'
@param {HTMLElement} start Node element from which we start searching
@param {String} attribute Attribute name
@param {Number} maxDepth Maximum number of elements to traverse, -1 for infinite
@param {HTMLElement} stopper Stop the search when reaching this element
@return {String} attribute value
Find the first parent of start element with the attribute specified by attribute