# Change colour of TextBox Web Component text on data change

**URL:** <https://forum.servoy.com/t/change-colour-of-textbox-web-component-text-on-data-change/20614>\
**Category:** Questions\
**Created:** [November 11, 2021, 3:29am UTC](https://forum.servoy.com/t/change-colour-of-textbox-web-component-text-on-data-change/20614 "2021-11-11T03:29:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![roddy](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@roddy](https://forum.servoy.com/u/roddy)\
**Post date:** [November 11, 2021, 3:29am UTC](https://forum.servoy.com/t/change-colour-of-textbox-web-component-text-on-data-change/20614/1 "2021-11-11T03:29:14Z")

</div>

I am unable to find a way to change the colour of the text in a TextBox web component depending on data. There is a style class but not style class data provider. It needs to be an editable field, so I wouldn’t be able to load it up with HTML tags. I feel I’m just missing something simple here…

---

<div class="post-metadata">

**Author:** ![ptalbot](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/ptalbot/32/4952_2.png) [@ptalbot](https://forum.servoy.com/u/ptalbot)\
**Post date:** [November 11, 2021, 10:32pm UTC](https://forum.servoy.com/t/change-colour-of-textbox-web-component-text-on-data-change/20614/2 "2021-11-11T22:32:45Z")

</div>

Have a look at elements.yourElementName .addStyleClass()/.hasStyleClass()/.removeStyleClass()

---

<div class="post-metadata">

**Author:** ![roddy](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@roddy](https://forum.servoy.com/u/roddy)\
**Post date:** [November 15, 2021, 5:40am UTC](https://forum.servoy.com/t/change-colour-of-textbox-web-component-text-on-data-change/20614/3 "2021-11-15T05:40:32Z")

</div>

Thanks @ptalbot; that hit the mark ![:D]( "Very Happy")
