telekommander
5/11/2015 - 2:43 PM

Wrap every 3 divs in a div

Wrap every 3 divs in a div

var divs = $("div > div");
for(var i = 0; i < divs.length; i+=3) {
  divs.slice(i, i+3).wrapAll("<div class='new'></div>");
}