Skip to content
Advertisement

Change text color based on condition

is there an example to change color of the text based on conditions? for example i want to make condition when $hasil>=80 it will turn green color, $hasil>=70 yellow, and below that is red color.

here’s my logic code

JavaScript

and here’s my table column

JavaScript

i want that those three column is using color condition thanks before

Advertisement

Answer

Try like this

JavaScript

I hope this is helps you!

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement