Prepared sample of codepan
The problem is the following:
Add an element in the DOM with class
at the same time want to hang the handler click
on all the items
, not hung several handlers after each function call, I removed the handler for the click
each item and then add again, but something is not removed as I want.
ie every time I click on +
the handler is still added to the previous items, do not understand how the DOM works.
PS well, or if you know another solution I would be glad to hear :)