# \[SOLVED\] How would I color individual dropdown labels? Or how would I add an icon to each?

**URL:** <https://forum.inductiveautomation.com/t/solved-how-would-i-color-individual-dropdown-labels-or-how-would-i-add-an-icon-to-each/79364>\
**Category:** Ignition\
**Tags:** ignition81, scripting, perspective\
**Created:** [September 19, 2023, 7:33pm UTC](https://forum.inductiveautomation.com/t/solved-how-would-i-color-individual-dropdown-labels-or-how-would-i-add-an-icon-to-each/79364 "2023-09-19T19:33:49Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Felipe\_CRM](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Felipe\_CRM](https://forum.inductiveautomation.com/u/Felipe_CRM)\
**Post date:** [September 19, 2023, 8:30pm UTC](https://forum.inductiveautomation.com/t/solved-how-would-i-color-individual-dropdown-labels-or-how-would-i-add-an-icon-to-each/79364/5 "2023-09-19T20:30:19Z")

</div>

I think this is referring to victordcq's js/html injection technique using the markdown component:

[https://docs.inductiveautomation.com/display/DOC81/Perspective+-+Markdown](https://docs.inductiveautomation.com/display/DOC81/Perspective+-+Markdown)

I've never tried it but there's some example projects that might shed some light on how it's done:

> [@Javascript inject in Perspective... have fun](https://forum.inductiveautomation.com/t/javascript-inject-in-perspective-have-fun/65805):
>
> Soo i'll just link this here... You can do whatever with it, but its not really gonna be clean or easy xD Have fun man_mage WARNING Dont let userinput enter in here

If I figure out how exactly to use it, I'll reply with more details. Or maybe someone else will chime in.

EDIT: I got it working like this.  
So the injection works on the dropdown option's label value, in this case, "YourLabel".

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/0/0037ba61f790a2782d366c48e18f54b4fff24d74.png)

Somewhere on the same view, you want a markdown component, it can probably be invisible but in this case I have it visible because I'm just using the existing example:

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/b/8b5167e3edc642afa52ae7ee62ae22b5d310e2e3.png)

Make sure the `markdown.escapeHtml` prop is set to `false` and the binding you want to set is on the `source` prop:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/d/1d4dacd06759a726fdcf4929503d1ac40f541a47.png)  
The injection payload goes inside the script transform.

---

_[View the full topic](https://forum.inductiveautomation.com/t/solved-how-would-i-color-individual-dropdown-labels-or-how-would-i-add-an-icon-to-each/79364)._
