I have written code that changes the color of the buttons when clicked to the color contained in the button’s data-color attribute… Please provide suggestions to improve this code.
The task asks to change the color of the button-bar (the element around the buttons) not the buttons themselves. Do you know how you could achieve that?
While it works to use innerText to get the color, it feels a bit brittle. In real projects texts tend to change over time, which would break your code. You could use the data-color attribute for that. There’s a nice way to access data-* attributes: dataset.
Feel free to ask questions if something isn’t clear.