code: function query( elem, selector ) {
      // append to fragment if no parent
      checkParent( elem );
  
      // match elem with all selected elems of parent
      var elems = elem.parentNode.querySelectorAll( selector );
      for ( var i=0, len = elems.length; i < len; i++ ) {
        // return true if match
        if ( elems[i] === elem ) {
          return true;
        }
      }
      // otherwise return false
      return false;
    }
docs: fall back to using QSA thx @jonathantneal https://gist.github.com/3062955