Skip to content

Instantly share code, notes, and snippets.

@AndrewRayCode
Created July 17, 2015 05:58
Show Gist options
  • Select an option

  • Save AndrewRayCode/0c86d5053baa58d638ec to your computer and use it in GitHub Desktop.

Select an option

Save AndrewRayCode/0c86d5053baa58d638ec to your computer and use it in GitHub Desktop.
hasParent( child, parent ) {
let node = child.parentNode;
while( node != null ) {
if( node === parent ) {
return true;
}
node = node.parentNode;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment