Created
December 16, 2011 17:47
-
-
Save msmorgan/1487099 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Which is more understandable, assuming you're not familiar with any JavaScript APIs? | |
//jQuery | |
$("<li/>").text("hello, world").appendTo($("<ul/>")).parent().appendTo(document.body); | |
//plain old JavaScript | |
var li = document.createElement("li"); | |
li.appendChild(document.createTextNode("hello, world")); | |
var ul = document.createElement("ul"); | |
ul.appendChild(li); | |
document.body.appendChild(ul); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment