JSFiddle - React, Tailwind, and code Playground

HTML

<div class="widget_output">
    <ul>
        <li>
            <p>
                <div>This is a random item</div>
                <div>This is a random item</div>
                <div>This is a random item</div>
                <div>This is a random item</div>
            </p>
       </li>
       <li>
            <p>
                <div>This is a random item</div>
                <div>This is a random item</div>
                <div>This is a random item</div>
                <div>This is a random item</div>
            </p>
        </li>
</div>

JavaScript

$(".widget_output div").replaceWith(function() { return "<span>" + this.innerHTML + "</span>"; });