JSFiddle - React, Tailwind, and code Playground
HTML
<span id="test">test</span>
JavaScript
var div = $("<div>").css({
"background": "red",
"width": "100px",
"height": "100px"
})
$("#test").wrap(div)
div.click(function() { alert("yay!") })