Answer the question
In order to leave comments, you need to log in
Why is the check class not removed when an element is removed?
It seems that the class is bound to the ID and it
is always unique, but it feels like the binding to the array index and I don’t understand what the problem is
...
delete the cross and the class is transferred to 2....
here is an example https://codepen.io/xxvxx/pen/yLajzNW
Answer the question
In order to leave comments, you need to log in
Because someone inattentively read the documentation .
UPD. Somehow I didn’t think to look at the js code right away. And there, and there ... WHAT THE FUCK IS THIS:
elem.classList.add('check');
elem.querySelector('input[type="checkbox"]').remove();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question