JSFiddle - React, Tailwind, and code Playground

HTML

<div id="hello[1][2]_world">&nbsp;</div>
<br />
<textarea id="console"></textarea>

JavaScript

$(document).ready(function() {
    
    
    $('#hello\\[1\\]\\[2\\]_world').html('01234'); //everything is OK
    
    var iid = 'hello[1][2]_world';    
    iid = iid.replace(/[#;&,.+*~':"!^$[\]()=>|\/]/g, "\\\\$&");
    $('#console').val(iid); //see in textarea, the same string as from first    
    
    $('#'+iid).html('56789'); //not working! whyyyyyyyy? :)
    
});