public/javascripts/yui/dom/dom.js
function(node, tagName) {
            node = Y.Dom.get(node);
            if (!node) {
                return null;
            }
            var method = function(el) {
                 return el[TAG_NAME] && el[TAG_NAME].toUpperCase() == tagName.toUpperCase();
            };

            return Y.Dom.getAncestorBy(node, method);
        }
function(node, tagName) {
            node = Y.Dom.get(node);
            if (!node) {
                return null;
            }
            var method = function(el) {
                 return el[TAG_NAME] && el[TAG_NAME].toUpperCase() == tagName.toUpperCase();
            };

            return Y.Dom.getAncestorBy(node, method);
        }
function ( node , tagName ) { node = Y . Dom . get ( node ) ; if ( ! node ) { return null ; } var method = function ( el ) { return el [ TAG_NAME ] && el [ TAG_NAME ] . toUpperCase ( ) == tagName . toUpperCase ( ) ; } ; return Y . Dom . getAncestorBy ( node , method ) ; }
Returns the nearest ancestor with the given tagName.
@method getAncestorByTagName
@param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point
@param {String} tagName
@return {Object} HTMLElement
Returns the nearest ancestor with the given tagName .