JSFiddle - React, Tailwind, and code Playground

HTML

<div>A</div>
<div>B</div>
<div>C</div>

JavaScript

$('div').each(function(index) {
   alert($(this).html());
   var test = $(this).html();
   $(this).html("<div><span>x_" + test + "</span></div>");
});