Was hoping someone could help me write a javascript that would based on highest text value change the color of the box to yellow.
In the screenshot there is 4 text element each with a value with a Unique ID (text1) assigned to them i just need to have some code that would change the color based on highest input value, so when the next text element is higher than the first i need that to change back to original color and then apply the yellow to new box.
The box that needs to change has an unique ID called Number1
Hi there,
here´s a new Version with coloring corresponding boxes with gradient, you asked for. You have to define the style of your choice in the Head-HTML, eg.:
Don´t forget to uncheck 'protect from external styles' in the document panel (or add an '!important' at the end of the style Definition)
Your script then would add the class 'mygradient' to the box, instead of setting its backgroundColor:
corrBox.classList.add ('mygradient');
Removing the class on init:
elm.classList.remove ('mygradient');
There´s a great thread about how to use gradients in Hype which also links to a very helpful website. It offers a bunch of gradient styles for your personal use.
I need your help again please, i change some of the project based on what i need but struggling with the last part to restore the text colour back to original.
Sorry to message you directly please just help me with this part