Skip to content

Instantly share code, notes, and snippets.

@VandeurenGlenn
Created April 3, 2015 00:02
Show Gist options
  • Save VandeurenGlenn/9506a095e83a7242ce89 to your computer and use it in GitHub Desktop.
Save VandeurenGlenn/9506a095e83a7242ce89 to your computer and use it in GitHub Desktop.
geteEementChildren
function elementChildren (element) {
var childNodes = element.childNodes,
children = [],
i = childNodes.length;
while (i--) {
if (childNodes[i].nodeType == 1) {
children.unshift(childNodes[i]);
}
}
return children;
}
console.log(elementChildren(this));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment