Assessment needed for task 3 - events

Hi,

I’ve done task 3 from the chapter about events. I used ‘event’s delegation’.
Please have a look at my code:
Events 3

Hi @CX-Cris,

Great code again. It works and thats what matters most. I will point out two things

  1. Test your skills Events 3 asks that you do the following

will set the background of the button-bar to the color contained in the button’s data-color attribute.

what your code does is use the innertext which works but isnt what the task asks you to do. Can you refactor your code so that it uses the data attributes? in this case it sets the color based on the “data-color” attribute.

  1. Not required but maybe good practice. You can also add an if statement to make sure that the colour only changes when the button is pressed. I keep forgetting that the nodeName is what we look for.

Good luck and enjoy.

Ran