JSFiddle - React, Tailwind, and code Playground

HTML

text<div> text </div><div> text </div><div> text </div>

JavaScript

$('div').replaceWith(function(){
      return "<br>"+$(this).html();
    });