I'm trying to customize the color of an <input> element based on it's current value.
So far I've tried solutions based on this question or this post, but can't get it to work even for a simple condition (e.g. "1<2"), and so even less based on the input's value (e.g. "value<2").
Here's a jsFiddle illustrating the problem, and my attempts below:
<p>
Simple coloring
<input autocomplete="off" id="spinner-twenty" style="background-color:red" class="spinner-twenty" name="spinner" value="0.1">
</p>
<p>
Conditional coloring based on style condition
<input autocomplete="off" id="spinner-twenty" style="${1} < 2 ? 'background-color:red' : 'background-color:white'" class="spinner-twenty" name="spinner" value="0.1">
</p>
<p>
Conditional coloring based on background-color condition
<input autocomplete="off" id="spinner-twenty" style="background-color:{!IF(1 < 4,'#7CFC00', '#FFA07A')}" class="spinner-twenty" name="spinner" value="0.1">
</p>
Conditional coloring based on background-color condition (based on inputs "value")
<input autocomplete="off" id="spinner-twenty" style="background-color:{!IF(value < 4,'#7CFC00', '#FFA07A')}" class="spinner-twenty" name="spinner" value="0.1">
</p>