Skip to content

Instantly share code, notes, and snippets.

@baconpat
Created June 29, 2011 00:06
Show Gist options
  • Save baconpat/1052550 to your computer and use it in GitHub Desktop.
Save baconpat/1052550 to your computer and use it in GitHub Desktop.
var addToTheList = function($elem, value) {
var itemHtml = '<li>' + value + '</li>',
selector = ".list";
$elem.find(selector).andSelf().filter(selector).append(itemHtml);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment