[jQuery] appying addClass to proper element (jquery 1.1 -> jquery 1.3.)

[jQuery] appying addClass to proper element (jquery 1.1 -> jquery 1.3.)


Hello,
I'm doing a modification on a javascript that is written for jquery
1.1 and wont work with jquery 1.3.
Heres is the shortened original code:
stars = $("div.star", obj),
...
stars.lt(rating[0]).addClass("on"); //critical line that causes error
I changed the line above to:
$("div.star:lt(" + parseInt(rating[0]) + ")").addClass("on");
which seems to work with jquery but it wont apply addClass to the
proper div.star element (if there are more than 1 div.star-s in the
html.
I'm wondering how should I change it so that it would apply properly
to the appropriate element?
Maybe something like:
stars.$(..