Using jQuery copy plugin from CSS Tricks
- by ftntravis
I'm trying to use this plugin that CSS Tricks suggests.
http://css-tricks.com/snippets/jquery/duplicate-plugin/
Shouldn't the following allow me to click a button and create a copy?
$.fn.duplicate = function(count, cloneEvents) {
var tmp = [];
for ( var i = 0; i < count; i++ ) {
$.merge( tmp, this.clone( cloneEvents ).get() );
}
return this.pushStack( tmp );
};
$('.copy').click(function() {
$('#form li').duplicate(5).appendTo('#form');
};
It's not working when I click it :(