I am trying to copy an existing Flickity slideshow from a <div>
into another one with the click of a button, using a simple javascript:
<script type="text/javascript">
function copyDiv() {
var firstDivContent = document.getElementById('test1');
var secondDivContent = document.getElementById('test2');
secondDivContent.innerHTML = firstDivContent.innerHTML;
}
</script>
This seems to somehow break the slideshow as the controls of the copied slideshow do no longer work after copying. This jsfiddle demonstrates what is happening: https://jsfiddle.net/johschmoll/bpv2ns6t/6/
Can someone point out to me why the copied slideshow no longer works and how I can get it to work?