$(".entry-summary:nth-child(5n)").addClass("last"); You can try the following code in Firebug console to debug: $('.entry-summary').removeClass('last');$('.entry-summary:nth-child(5n)').addClass('last');