# Need help for events 3 skill text

**URL:** <https://discourse.mozilla.org/t/need-help-for-events-3-skill-text/108993>\
**Category:** Learn\
**Created:** [December 18, 2022, 12:21pm UTC](https://discourse.mozilla.org/t/need-help-for-events-3-skill-text/108993 "2022-12-18T12:21:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alireza\_alinezhad](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@alireza\_alinezhad](https://discourse.mozilla.org/u/alireza_alinezhad)\
**Post date:** [December 18, 2022, 12:21pm UTC](https://discourse.mozilla.org/t/need-help-for-events-3-skill-text/108993/1 "2022-12-18T12:21:51Z")

</div>

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

[https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building\_blocks/Test\_your\_skills:\_Events#events\_3](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Test_your_skills:_Events#events_3)

---

<div class="post-metadata">

**Author:** ![mikoMK](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/mikomk/32/50456_2.png) [@mikoMK](https://discourse.mozilla.org/u/mikoMK)\
**Post date:** [December 25, 2022, 7:23am UTC](https://discourse.mozilla.org/t/need-help-for-events-3-skill-text/108993/2 "2022-12-25T07:23:33Z")

</div>

Hi @alireza_alinezhad

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.

- The `target` property of the event object (`e`) points to the element that was actually clicked.
- Use `getAttribute()` to get the color from this element

```auto
function setColor(e) {
  buttonBar.style.backgroundColor = /* Add the missing part */ ;
}

buttonBar.addEventListener('click', setColor);

```

See you,  
Michael
