How to display different colors for diffent variables?

admin

Administrator
Staff member
I want to write a simple javascript to display different colors for
different variables.

e.g.

a[1] = "Hello"
a[2] = "World"
a[11] = "I"
a[12] = "am"
a[13] = "Vincent"
a[21] = "!"


if array = a[1] to a[10] , then display in "Red color"
if array = a[11] to a[20] , then display in "Blue color"
if array = a[21] to a[30] , then display in "Green color"

Result

Display in different colors : "Hello World I am Vincent !"

Thank you very much!!!

Vincent
 
Back
Top