example/auction/src/client.js
function upTo(el, tagName) {
  tagName = tagName.toLowerCase();

  while (el && el.parentNode) {
    el = el.parentNode;
    if (el.tagName && el.tagName.toLowerCase() == tagName) {
      return el;
    }
  }
  // Many DOM methods return null if they don't
  // find the element they are searching for
  // It would be OK to omit the following and just
  // return undefined
  return null;
}
function upTo(el, tagName) {
  tagName = tagName.toLowerCase();

  while (el && el.parentNode) {
    el = el.parentNode;
    if (el.tagName && el.tagName.toLowerCase() == tagName) {
      return el;
    }
  }
  // Many DOM methods return null if they don't
  // find the element they are searching for
  // It would be OK to omit the following and just
  // return undefined
  return null;
}
function upTo ( el , tagName ) { tagName = tagName . toLowerCase ( ) ; while ( el && el . parentNode ) { el = el . parentNode ; if ( el . tagName && el . tagName . toLowerCase ( ) == tagName ) { return el ; } } // Many DOM methods return null if they don't // find the element they are searching for // It would be OK to omit the following and just // return undefined return null ; }
Find first ancestor of el with tagName or undefined if not found
Find first ancestor of el with tagName or undefined if not found