can't test for am in last element or not.....

can't test for am in last element or not.....


example

I can change the css for the last element with a simple event-binding (triggered by a link), but I can't test for whether am clicking on link in last <section> or not.....

i.e., this works...

  1.       $('section:last a').css('color','#ccc');

but for some reason this does not work:

  1. if ($(this).parent().parent().is(':last')) {
  2.     console.log('last'); // fires off even if click on link in last 'section'
  3. //    } else if ($(this).parent().parent().not('div section:last')) {
  4. } else if ($(this).parent().parent().not('last')) {
  5.     console.log('not last');
  6. }

(I posted a question here about this a few weeks ago, but I removed the post by mistake (but it hadn't been resolved...;-)

thank you....