I'm trying to clone javascript div id with this code
<script>
var div = document.getElementById('pruebaz2'),
clone = div.cloneNode(true); // true means clone all childNodes and all event handlers
clone.id = "pruebaz2";
document.body.appendChild(clone);
</script>
but my clone div id not have any effect in my html page
my original id add a record when a doing a click
my clone id do nothing
how I can clone with same functionality