how to clone whole div with content on click code example
Example 1: jquery clone object
// Shallow copy
var newObject = jQuery.extend({}, oldObject);
// Deep copy
var newObject = jQuery.extend(true, {}, oldObject);
Example 2: js copy a div
// Get the element
var elem = document.querySelector('#elem1');
// Create a copy of it
// The 'true' is to allow nested elements to be copied as well
var clone = elem.cloneNode(true);