Если .cf-container
всегда является предыдущим братом .content
:
$(".content").each(function() {
let _this = $(this);
_this.prev(".cf-container").append(_this);
});
Если между .content
и .cf-container
$(".content").each(function() {
let _this = $(this);
_this.prevAll(".cf-container").first().append(_this);
});
будут другие братья