function isChildOf (elem, parent) {
  let e = elem.parentNode
  while (e) {
    if (e === parent) {
      return true
    }
    e = e.parentNode
  }

  return false
}
Test if an element is a child of a parent element.
@param {Element} elem
@param {Element} parent
@return {boolean} returns true if elem is a child of the parent