JSFiddle - React, Tailwind, and code Playground

HTML

<div class="container">
<div class="hello"><p>1</p></div>
<div class="goodbye">2</div>
<div class="hello"><p>3</p></div>
<div class="goodbye">4</div>
</div>

JavaScript

alert("before remove");
$('.container .hello').remove();