JSFiddle - React, Tailwind, and code Playground

by James Allardice

HTML

<div id="id">Inspect the DOM and see the preceding sibling</div>

JavaScript

$("div#id").before("<div>").after("</div>");