JSFiddle - React, Tailwind, and code Playground

by Ender

HTML

<textarea id="target"></textarea>

<ul id="last"></ul>

JavaScript

var keys = [];
$('#target').keypress(function(e) {
    keys.unshift(e.which);
    update();
});

function update() {
       $('#last')
           .prepend($('<li/>').text(String.fromCharCode(keys[0])))
           .children(':eq(2)').remove();
}