samedi 21 mars 2015

Random color for each child element

I'm trying to write a function which will set a random text color to any element with 'randomcolor' class. So I have this



$('.randomcolor').each( function() {
$(this).css('color', randomColor());
}


..but it doesn't seem to work, even though it doesn't make any errors.


randomColor() function works pretty well, I've already tested it.


So what's the problem with my code?





Aucun commentaire:

Enregistrer un commentaire