I have a function that uploads and image and adds a preview to this image, and i have two buttons, when i click on the first one it clicks on the input type file and opens it, a
you can append the element instead of duplicating it. you can change the classes and ids using variables.
$('.duplicate').click(function() { var newClass="new-class"; var toAppendElement = '' + 'Open uploader' + '' + '' + ''; $(".cloned").append(toAppendElement); })
http://jsfiddle.net/8h3gcyhz/