Skip to content

Instantly share code, notes, and snippets.

@tobie
Created August 11, 2008 12:52
Show Gist options
  • Save tobie/4856 to your computer and use it in GitHub Desktop.
Save tobie/4856 to your computer and use it in GitHub Desktop.
Element.addMethods({
clone: function(element) {
var clone = $(element).cloneNode(true);
$(clone).select('*[id]').concat(clone).invoke('writeAttribute', { id: null });
return clone;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment