jquery: how do i check if an element is the last sibling?

Posted by Haroldo on Stack Overflow See other posts from Stack Overflow or by Haroldo
Published on 2010-04-21T09:13:45Z Indexed on 2010/04/21 9:23 UTC
Read the original article Hit count: 118

Filed under:

for the last cell in a row i want to perform a different action:

this doesn't work:

$('td').each(function(){
    var $this = $(this);
    if ( $this === $this.parent().last('td') )
        {
            alert('123');
        }
})

and neither does it if i remove .parent()

© Stack Overflow or respective owner

Related posts about jQuery