So I'm creating multiple new child divs inside another parent div
with this code:
var parentDiv = document.querySelector('.parent-div')
const newDiv = document.createElement('div');
parentDiv.appendChild(newDiv);
So now I want to add an onlick
event for every div
I created, that resets the color for every other div
inside the parent div
, so that no multiple child divs are selected, and then set the color only for the clicked div
to another color!
Any ideas?