Take a look at slice() . This will split the array returned by $("p") for use with .each() :
$("p").slice(0, 4).each(function() {
.slice() takes a start and end index as parameters. In the above example, we start from the first element of the array (index 0) and return the next 5 elements to index 4.
Bojangles
source share