Skip to content

Instantly share code, notes, and snippets.

@neonux
Created June 9, 2011 09:53
Show Gist options
  • Save neonux/1016444 to your computer and use it in GitHub Desktop.
Save neonux/1016444 to your computer and use it in GitHub Desktop.
/* first call */
listElement.children.length // => 0
listElement.appendChild(newListItemElement);
listElement.children.length // => 0 (still!??)
/* second call (async, not within the same execution context) */
listElement.children.length // => 1 (cool! the item above got actually appended)
listElement.appendChild(newListItemElement);
listElement.children.length // => 2 (right!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment