Coloring Text with JS and negative numeric variable ranges

Any idea on how to use negative numeric values for variable ranges? var colorMatch = … Read more Coloring Text with JS and negative numeric variable ranges

Any idea on how to use negative numeric values for variable ranges?

var colorMatch = {
'0-19'     : 'red',
'20-59'    : 'orange',
'60-100'   : 'green'

};

I’ve been using this JS code from previous question to color text with variable numeric ranges

https://stackoverflow.com/a/31805767/7922942

Which links to this Fiddle

For example i’m trying to '-5-0' : 'blue', etc

Any thoughts/work arounds?

Source: JavaSript – Stack Overflow


Categories: NewsTags: , ,

Tags: , ,


Leave a Reply

Your email address will not be published. Required fields are marked *