This page first loads 4 words into the options DIVs via Ajax and then randomizes the correct answer with the following function, passing the DIV containing the elements to be randomized as the argument:
var random = function(r){
r.children().sort(function(a,b){
var temp = parseInt( Math.random()*10 );
return( temp%2 );
}).appendTo(r);
};
random($("#option"));
<div id="option">
<div class="option" id="option1" style="background-color: rgb(229, 232, 238); ">light</div>
<div class="option" id="option4" style="background-color: rgb(183, 190, 204); ">pot</div>
<div class="option" id="option2" style="background-color: rgb(183, 190, 204); ">garlic press</div>
<div class="option" id="option3" style="background-color: rgb(183, 190, 204); ">habitant</div>
</div>
The problem is that in Safari the correct answer is always in the top position...
And in IE 7 and 8 it's in the top position far more often than not.
I know it would be possible to make the function "more random" by using a timestamp in there or something but I'm struggling to make it work properly.