JSFiddle - React, Tailwind, and code Playground

HTML

<b>This is what im thinking:</b> <br /><br />
1. If the span that is previous to ".well-well" does not hold class ".dont-remove" then remove span previous to ".well-well"
<br /><br />
2.If span previous to ".well-well" holds class ".dont-remove" = dont do anything

<div>
    <span class="dont-remove">.dont-remove</span> <!-- not to be removed -->
    <span class="well-well">.well-well</span>
</div>

<div>
    <span class="">*remove*</span> <!-- to be removed -->
    <span class="well-well">.well-well</span>
</div>

Obviously now its just removing the previous span to .well-well while ignoring the fact that one of these divs has .dont-remove
<br /><br />
Im sure theres somekind of mistake in this code..?

CSS

div { background: #e1e1e1; width: 300px; height: 100px; margin: 13px 0px 13px 0px; }
.dont-remove { background: #12b4ff; } /* blue */
.well-well { background: #ff5a12; } /* orange */

JavaScript

if( $(".well-well").prev('span').not('.dont-remove') ){ $(".well-well").prev('span').remove(); }