Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <div class="maindiv">
     <div class="box"></div>
     <div class="box"></div>
     <div class="box"></div>
     <div class="box"></div>
  </div>
</body>
</html>
 
var boxes = $(".maindiv > .box");
for (var i = 0, len = boxes.length; i < len; i += 2) {
  boxes.slice(i, i + 2).wrapAll("<div></div>");
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
_alexander_pro
0viewers