In this fiddle, http://jsfiddle.net/mjmitche/urfXq/44/ there is an array which is graphically represented by three small boxes (red, blue, green). If you click the bigger black box, it’s supposed to
First — randomly choose one element (either RED, BLUE or GREEN) from the array
Second — assign that randomly chosen color to a variable called “randomlyChosenColor”–I’m sure I did this part wrong.
Third –use the function toLowerCase on the id of the randomly chosen color id
So, I’m sure that none of that is working, because I’m a newbie, but just to make sure, how can I
a) test to see what is contained in the variable randomlyChosenColor ? is there a print_r type function that php has?
b) if there is problems with my program, can you please help me see what needs to change?
Why did I assign the return value to a variable and to lower case?
After the color is randomly chosen and assigned to a variable, the user (in a part not written yet) is going to guess which was randomly chosen, so the variable is put to lower case to compare it to the button the user will click later on
I’ve changed your code a bit:
Result: http://jsfiddle.net/urfXq/46/