JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="ansbox" value="H E L L O" />

JavaScript

var notrightfake = $("#ansbox").val();
var notright = notrightfake.replace(" ", "");
document.write(notright);