Great, that helps but I think I'll do it from the server side code,
the web page loads much faster when the operation is done on the
server side.

On Mar 20, 12:58 pm, Charlie Griefer <charlie.grie...@gmail.com>
wrote:
> On Fri, Mar 20, 2009 at 9:48 AM, Thierry <lamthie...@gmail.com> wrote:
>
> > I have a bunch of hyperlinks with class 'hello_world'.  I want to
> > assign each one of them a random colour.  I can set the colour for all
> > of them with the following:
>
> > $("a[class=hello_world]").css("color", "red");
>
> > How can I iterate over every element with class name 'hello_world'?
>
> $(function() {
> $('a[class=hello_world]').each(function() {
>  randomColor = (some code here to create a random color);
>  $(this).css('color', randomColor);
>
> });
> });
>
> --
> I have failed as much as I have succeeded. But I love my life. I love my
> wife. And I wish you my kind of success.

Reply via email to