Simple reproduce case:
<html>
<head>
<script src="http://code.jquery.com/jquery-1.6.min.js"></script>
</head>
<body>
<script>
$('body').append(
'<span></span>',
'<span></span>',
'<span></span>'
)
</script>
</body>
</html>
The bug is in this block: https://github.com/jquery/jquery/blob/1.6/src/manipulation.j...Note the inner loop is clobbering the outer loop's "i" variable.