JSFiddle - React, Tailwind, and code Playground
HTML
<input id="textCommand" type="text"><br/>
JavaScript
$('#textCommand').on('keypress', function(e) {
if(e.keyCode==13) {
sendConsole();
}
});
var user = {};
var sendConsole = function() {
value = $('#textCommand').val();
if (value.substring(0,1) === "/") {
alert(value);
} else {
$('body').append("<span>unknown command: "+value+"</span><br />")
$('#textCommand').val("");
}
}