Skip to content

Instantly share code, notes, and snippets.

@fixable11
Created July 7, 2018 15:41
Show Gist options
  • Save fixable11/2001f19b53611c8c5d322bd5804ceea5 to your computer and use it in GitHub Desktop.
Save fixable11/2001f19b53611c8c5d322bd5804ceea5 to your computer and use it in GitHub Desktop.
//check if the first node is an element node
function get_firstChild(n) {
var y = n.firstChild;
while (y.nodeType != 1) {
y = y.nextSibling;
}
return y;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment