Skip to content

Instantly share code, notes, and snippets.

@Will-Sommers
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Will-Sommers/cae518da335bf1e0ca96 to your computer and use it in GitHub Desktop.
Save Will-Sommers/cae518da335bf1e0ca96 to your computer and use it in GitHub Desktop.
function addLiTemplate(content) {
var template = $("#li-template").clone() // this template is hidden insid the HTML markup with css {display:none;}
return template.find("#todo").text(content)
};
// or
function addLiTemplate(content) {
$('<li/>', {
id: 'foo',
text: content
}).appendTo('#myList');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment