jQuery deep copy, creates a copy of an array of identical elements while preserving the dynamic state of any identical form elements.
jquery clone element, jquery clone element and append, javascript clone element with events, jquery clone child elements, jquery copy attributes from one element to another
How to make use of it:
1. Download and place the jq-deepest-copy.js
after loading the newest jQuery library.
<script src="/path/to/cdn/jquery.slim.min.js"></script> <script src="/path/to/jq-deepest-copy.js"></script>
2. Deep copy all matched components within the ‘elements-to-copy’.
<!-- Source --> <ul class="source"> <li class="elements-to-copy"> <select name="languages" id="languages" class="form-control"> <option value="1">JavaScript</option> <option value="2">HTML5</option> <option value="3">CSS/CSS3</option> </select> </li> </ul> <!-- Destination --> <ul class="destination"> </ul>
var elements_to_copy = $('li.elements-to-copy'); var destination_container = $('ul.destination'); $(elements_to_copy).copy().appendTo(destination_container);
<!-- Results --> <ul class="destination"> <li class="elements-to-copy"> <select name="languages" id="languages" class="form-control"> <option value="1">JavaScript</option> <option value="2">HTML5</option> <option value="3">CSS/CSS3</option> </select> </li> </ul>
Deep Clone A Set Of DOM Elements, jq-deepest-copy Plugin/Github, copy div content to another div javascript
See Demo And Download
Official Website(blackirishmec): Click Here
This superior jQuery/javascript plugin is developed by blackirishmec. For extra Advanced Usages, please go to the official website.