Skip to content

Instantly share code, notes, and snippets.

@rblakejohnson
Created June 18, 2013 14:34
Show Gist options
  • Select an option

  • Save rblakejohnson/5805870 to your computer and use it in GitHub Desktop.

Select an option

Save rblakejohnson/5805870 to your computer and use it in GitHub Desktop.
JS: create new element
var targetArea = document.getElementById("target-area"),
p = document.createElement("p"),
snippet = p.createTextNode("This was created with JS.");
targetArea.appendChild(snippet);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment