hi i get stuck to completing task 3 in events test skill can anyone help me?
i know that i should do it by event delegation but i don’t know how to do it.
here’s the link of task
hi i get stuck to completing task 3 in events test skill can anyone help me?
i know that i should do it by event delegation but i don’t know how to do it.
here’s the link of task
I hope I’m not too late for a hint.
Below you see the solution code with just the right part of the assignment missing.
target property of the event object (e) points to the element that was actually clicked.getAttribute() to get the color from this elementfunction setColor(e) {
buttonBar.style.backgroundColor = /* Add the missing part */ ;
}
buttonBar.addEventListener('click', setColor);
See you,
Michael