Skip to content

Instantly share code, notes, and snippets.

@jasonmoo
Created December 22, 2013 00:09
Show Gist options
  • Save jasonmoo/8076888 to your computer and use it in GitHub Desktop.
Save jasonmoo/8076888 to your computer and use it in GitHub Desktop.
function generate_dom(string) {
var t = document.createElement('div');
t.innerHTML = string;
return t.children.length === 1 ? t.children[0] : t.children;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment