Hi Mauricio,

> Let's loop the div.description using the each() method.
>
>   $('.description') .each(function(){
>   $('img:eq(0)', this).addClass('icon_selected');
>   });

thank you very much. Your suggestion with .each works very well. This
is what I have ended up with (see below). One question: I don't quite
understand the bit where it says "$('img:eq(0)', this)". Is that the
multiple selectors syntax (http://docs.jquery.com/Selectors/
multiple#selector1selector2selectorN)? Or is this syntax to do with
the .each statement? Sorry if this is a lame question, I am an
absolute beginner.

$("div.description").each(function() {
        $("a.colour:first img.icon", this).addClass("icon_selected");
        $("a.size:first img.icon", this).addClass("icon_selected");
});

Best regards,
Martin

Reply via email to