javascript/selenium-core/lib/prototype.js
function(event, tagName) {
    var element = Event.element(event);
    while (element.parentNode && (!element.tagName ||
        (element.tagName.toUpperCase() != tagName.toUpperCase())))
      element = element.parentNode;
    return element;
  }
function(event, tagName) {
    var element = Event.element(event);
    while (element.parentNode && (!element.tagName ||
        (element.tagName.toUpperCase() != tagName.toUpperCase())))
      element = element.parentNode;
    return element;
  }
function ( event , tagName ) { var element = Event . element ( event ) ; while ( element . parentNode && ( ! element . tagName || ( element . tagName . toUpperCase ( ) != tagName . toUpperCase ( ) ) ) ) element = element . parentNode ; return element ; }
find the first node with the given tagName, starting from the node the event was triggered on; traverses the DOM upwards
find the first node with the given tagName starting from the node the event was triggered on ; traverses the DOM upwards