JSFiddle - React, Tailwind, and code Playground

HTML

<p style="background:#00FF66">#1 p-inner-first</p>
<div style="background:#00FF66">#2 div-first</div>
<p style="background:#00FF66">#3 p-inner-second</p>    
  
<div>
    <p style="background:#FF6633">#4 p-inner-third</p>
    <div id="test" style="background:#FF6633">#5 div-second</div>
    <p style="background:#FF6633">#6 p-inner-fourth</p> 
    <div style="background:#00FF66"><p>#7 hello</p></div>
</div>   

<p style="background:#00FF66">#8 p-inner-fifth</p>
<div style="background:#00FF66">#9 div-third</div>
<p style="background:#00FF66">#10 p-inner-sixth</p>

JavaScript

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

//$("#test, > p", $('#test').parent()).remove();

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

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

//$("#test").siblings("p").siblings("#test").remove();

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