JSFiddle - React, Tailwind, and code Playground

HTML

<div id='test'>This is div test</div>
<p>This is sibling p</p>

JavaScript

$("#test").siblings('p').remove().end().remove();