Home › Forums › JavaScript › Change Menu_Item Font Color › Reply To: Change Menu_Item Font Color
September 14, 2013 at 8:58 am
#150072
whatsoever
Participant
This would do it ;)
You first tired to define colors as an object, using object literal notation like so: var colors = {'red', 'green, ... etc};
And colors actually needs to be an array: var colors = ['red', 'green',...etc];
Just a heads-up, when defining objects using object literal notation remember that objects contain key:value pairs, like so: var my_object = { key1: value1, key2:value2 ... };
Then they can be accessed using this:my_object.key1; // returns value1