How do you clone a unique instance of a cloned list item? The way I have it currently coded, always creates a duplicate of itself - for example, I clone a list item once, it creates one copy, then I clone the same list item again and it creates two copies.
Here is the code:
HTML:
<ul>
<li><button onclick='cloneit(this);'>Clone</button> List Item A</li>
<li><button onclick='cloneit(this);'>Clone</button> List Item B</li>
</ul>
Javascript:
function cloneit(thisone) {
var parent = $(thisone).parent();
$(parent).clone().appendTo(parent);
}
You can see the above at this jsFiddle: http://jsfiddle.net/57kx6u3j/
To duplicate the problem, click on Clone for List Item A and you'll see it cloned once, then click on the same button and you'll see it cloned twice.