JSFiddle - React, Tailwind, and code Playground

HTML

<input id="entersomething" />
<div id="displaysomething"></div>

JavaScript

$("#entersomething").keyup(function(e){alert("up");
    var code = (e.keyCode ? e.keyCode : e.which);
    if(code==13)e.preventDefault();
    if(code==32||code==13||code==188||code==186){
        $("#displaysomething").html($(this).val());
    });