Why selector works in first example, but fails in second one? See jsfiddle.
<div id="hello[1][2]_world"> </div>
<textarea id="console"></textarea>
<script>
$(document).ready(function() {
//first example
$('#hello\\[1\\]\\[2\\]_world').html('01234'); //everything is OK
//second example
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? :)
});
</script>