Skip to content

Instantly share code, notes, and snippets.

@jbrooksuk
Created April 11, 2011 12:28
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 jbrooksuk/913432 to your computer and use it in GitHub Desktop.
Save jbrooksuk/913432 to your computer and use it in GitHub Desktop.
Creates DOM elements taking an element and a set of attribute properties
(function($) {
$.fn.create = function(el, attr) {
return jQuery(document.createElement(el)).attr(attr).prependTo(this);
}
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment