I can\'t seem to get the appendTo to work. What do I do wrong?
$(\'div:nth-child(2n) img\').appendTo(parent);
Current markup:
&
Is this what you're after?
$('.container > img').each(function () { $(this).parent().append(this); });
It simply takes the within every container and moves as the first child of the container.