JSFiddle - React, Tailwind, and code Playground

HTML

<form>   <fieldset>     <input id="target" type="text" value="Hello there" />   </fieldset> </form> <div id="other"></div>

JavaScript

$("#target").keypress(function(e) {
    $('#other').append($(this).val() + String.fromCharCode(e.which) + '<br />');
});