Reputation: 236
I have a form that is containing one input.
When a user is clicking on a button, this input will be cloned and the clone will be inserted after the original input.
The user is also able to remove the clone.
My problem is, when I remove the original element that used to create the clone, all cloned element are removed too.
I only want to remove the target input that the user is choosing.
Upvotes: 1
Views: 649
Reputation: 647
A cloned element is not linked to the original element. What is more likely is that the selector you are using to delete an element has too broad a scope and so is deleting them all. This can also happen if you are selecting by ID and, as a commenter has suggested, you have cloned the ID to each element as well.
Without some code snippets, it's hard to fully diagnose the issue.
Upvotes: 1