Random jQuery Background color does not work in Firefox?

advertisements

I need some help here. Checkout this fiddle: http://jsfiddle.net/ydNn6/5/

my Code:

$('.start').each(function () {
    var color = (Math.floor(Math.random()  * 256));
                    var hue = 'rgb(' + color + ',' + color + ',' + color + ')';
    $(this).css('backgroundColor', hue);
});

I want every div to be in a random greyscale color, however this is not working in Firefox, works fine in Chrome though. The funny thing is I got inspired to do this from this site: http://noemi.ro/draw.html which works fine in Firefox despite having almost the same code.

Any help appreciated, thanks

M

EDIT: What the hell, now it's working, but not in my html, just in the fiddle...


You forgot to include jQuery on your JS Fiddle. Add it and it works.