Hi Tomek,

It works fine for me. How are you testing this? If you have Firefox with Firebug, inspect the last-child element after adding the class. When I did so, I saw this:

<div class="info green last">bar </div>

(I had added "bar" to the HTML for the sake of my test.)

--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Jan 5, 2008, at 7:22 AM, poncjusz wrote:


Hi,

I've got strange problem with :last-child selector, my html structure:
<div class="box-full">
   <div class="info green">
   </div>
   <div class="info green">
   </div>
</div>

and jquery script:
$(".box-full .info:last-child").addClass("last");

what is strange that
$(".box-full .info:first-child").addClass("last");
works perfect!

thanks in advance

Tomek


Reply via email to