How do you know if the current element is not the first-child?
It should work with $(this)
, for example:
$("li").click(function(e) {
if (/* $(this) is not the first-child */)
{
/* do something */
}
});
You can do this just to test an element if it's the first child: $(this).is(':first-child')
. Other selectors like :last-child
would work too.