In JavaScript we can create copies of arrays and as we change the contents of that array, the copy's contents also change (as an identical copy of the pointer array).
My question is simply can we achieve this with div elements in html and javascript (or jquery). So for example i have 2 div elements:
<div class="cont1"><p contenteditable="true">Some text...</p></div>
<div class="cont2"><p contenteditable="true">Some text...</p></div>
Both have contenteditable p elements. I want to be able to reflect the changes of cont1 to mirror the changes in cont2, when either p tags are edited.
Javascript is fine, jQuery is preferable.
*If question is not well worded please comment instead of downvoting it, i will immediately make it clearer. Thanks a lot!