Say I have 6 child divs and they don\'t have unique identifiers:
This should do it:
var $children = $('.child'); for(var i = 0, l = $children.length; i < l; i += 3) { $children.slice(i, i+3).wrapAll(''); }
DEMO