I'm trying to clone items, the first section seems to work when I clone it the cone items don't work in the second section
Cloning items
- Edited
document.querySelector() returns the first node matching the query; as soon as you clone the first section you'll have two nodes that match the .place-section
selector, but querySelector()
will only return the first one.
Similarly for adding the event listeners; they all get attached to the first occurrences of their respective buttons.
You could look at document.querySelectorAll() but you'd still be in the position of having to work out which of the returned nodes is the intended one.
Just like this I guess