JSFiddle - React, Tailwind, and code Playground
HTML
<div id=''>
test1
</div>
<div id='id1'>
test2
</div>
<div id=''>
test3
</div>
JavaScript
$('<br />').insertBefore('#id1');
$('<br />').insertAfter('#id1');
<div id=''>
test1
</div>
<div id='id1'>
test2
</div>
<div id=''>
test3
</div>
$('<br />').insertBefore('#id1');
$('<br />').insertAfter('#id1');