JSFiddle - React, Tailwind, and code Playground

by David Thomas

HTML

<ul>
  <li class="this-one"> 
  this is my item
   <ul>
    <li>
       this is a sub element
    </li>
   </ul>
  </li>
</ul>

JavaScript

$('li').each(
    function(){
        $(this).wrapInner('<div class="tree-item-text" />');
    });