Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Change Menu_Item Font Color Reply To: Change Menu_Item Font Color

#150072
whatsoever
Participant

This would do it ;)

http://jsfiddle.net/VzDhP/

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