JSFiddle - React, Tailwind, and code Playground
HTML
<div id="before">
</div>
<br />
<div id="after">
</div>
JavaScript
var str = 'Xhellox, hxow Are youx doing?'
$('#before').html(str);
str = str.replace(/X|x/g, '');
$('#after').html(str);
<div id="before">
</div>
<br />
<div id="after">
</div>
var str = 'Xhellox, hxow Are youx doing?'
$('#before').html(str);
str = str.replace(/X|x/g, '');
$('#after').html(str);