@ John Hartsock's solution is concise but ineffective due to how many times selectors are triggered. I would suggest an option:
var i = 0, quotes = $("div.quoteWrapper").children(), group; while ((group = quotes.slice(i, i += 6)).length) { group.wrapAll('<div class="sixQuoteWrapper"></div>'); }
This solution works with the short selector only once and returns the children, making it faster.
Working demo: http://jsfiddle.net/AndyE/FFf6z/
source share