Skip to content

Instantly share code, notes, and snippets.

@Daniel-Hug
Last active December 21, 2016 06:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Daniel-Hug/2cdfeee2eec69e91b010f899ec315934 to your computer and use it in GitHub Desktop.
Save Daniel-Hug/2cdfeee2eec69e91b010f899ec315934 to your computer and use it in GitHub Desktop.
JS function: get array of descendant elements. Source: http://stackoverflow.com/a/17821774/552067
// get array of descendant elements
function getDescendantElements(parent) {
return [].slice.call(parent.getElementsByTagName('*'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment