JSFiddle - React, Tailwind, and code Playground

HTML

<div id="stuff[0]">
    <div id="tag">blah</div>
</div>
<div id="stuff[1]">
    <div id="tag">blah</div>
</div>

JavaScript

var id = "#" + "stuff\\[0\\]";
$(id).append("<p>HI</p>");