JSFiddle - React, Tailwind, and code Playground
HTML
<textarea id="input-1" placeholder="Type a space here"></textarea>
<br/>
Char code: <span id="char-1"></span>
<br/>
<textarea id="input-2" class="no-wrap" placeholder="Type a space here"></textarea>
<br/>
Char code: <span id="char-2"></span>
<br/>
<button id="do">Get Chars</button>
CSS
.no-wrap {
resize: none;
white-space: nowrap;
overflow: auto;
}
JavaScript
$("#do").click(function(){
var value = $("#input-1").val();
$("#char-1").text(value.charCodeAt(value.length - 1));
value = $("#input-2").val();
$("#char-2").text(value.charCodeAt(value.length - 1));
});