In this fiddle http://jsfiddle.net/SySRb/40/, I created an array with two elements, #f-ONE and #ONE. There is a function that, when the “start” box is clicked, selects one of the two elements randomly, and, depending on which is chosen, displays either a yellow or reddish box.
However, in actual fact, it is always the yellow box that is selected, so something is not working.
However, the exact same code that selects things randomly works in other contexts (see http://jsfiddle.net/urfXq/96/ ), so I don’t know what the problem is…
this:
should be:
The way you had it, it will always evaluate to
true, because a non-empty string is always “truthy”.EDIT: Didn’t see the
toLowerCase().