How do you know if the current element is not the first-child?
It should work with $(this), for example:
$(this)
$(\"li\").click(function(e) {
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.
$(this).is(':first-child')
:last-child