Change HTML button dynamically

0
I want to change the color and text of my html element(typically a button) based on the database value received. Its a time series API and keeps sending the data continuously. Based on the value received, if value goes above +5%, button should change to red, within the range +1%to+5%, it should remain yellow and normal should remain green.  How can i achieve it.
asked
1 answers
5

Multiple ways of doing this, for example:

  1. You can use conditional visibility to show a different container with a different class on the element base on the value of the attribute
  2. You can use the css selector helper widget to set a class based on the attribute: https://appstore.home.mendix.com/link/app/35039/
  3. You can use the css class switcher: https://appstore.home.mendix.com/link/app/109716/ to set a class based on a microflow
answered