//
https://api.jquery.com/wrapall/
https://api.jquery.com/wrapinner/
Wrap an HTML structure around each element in the set of matched elements.
在一组匹配的元素中的每个元素周围包装一个HTML结构。
<div class="container">
<div class="inner">Hello</div>
<div class="inner">Goodbye</div>
</div>
$( ".inner" ).wrap( "<div class='new'></div>" );
<div class="container">
<div class="new">
<div class="inner">Hello</div>
</div>
<div class="new">
<div class="inner">Goodbye</div>
</div>
</div>
$( ".inner" ).wrap(function() {
return "<div class='" + $( this ).text() + "'></div>";
});
<div class="container">
<div class="Hello">
<div class="inner">Hello</div>
</div>
<div class="Goodbye">
<div class="inner">Goodbye</div>
</div>
</div>
React & GraphQL
https://gist.github.com/xgqfrms-GitHub/d3f1ac685335d481572d5390d7c31a1c