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.
mikoMK
(Michael Koch)
2
Hi again @Sujal_Dhiman
This is also correct. 
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