Assessment wanted for Events 3 skill test (MDN DOCS)

Hey Everyone!

Would love to have your views on my Event3 skill test code. Any Improvements in the code are welcomed.

Code-Link: https://codepen.io/SujalDhiman/pen/yLRLbvy

MDN-SECTION: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Test_your_skills:_Events

Thanks for giving your valuable time.

Hi again @Sujal_Dhiman

This is also correct. :clap:
Instead of the template string with a single variable, you could simply use color.

Two single-line alternative to make your code a bit simpler:

buttonBar.style.backgroundColor = event.target.getAttribute('data-color');
buttonBar.style.backgroundColor = event.target.dataset.color;

I hope that helps,
Michael