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.
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.