JSFiddle - React, Tailwind, and code Playground

by brigand

HTML

<input type="text" id="inp">
<pre id="out"></pre>

JavaScript

inp.onkeypress = event => {
	out.textContent += '\n';
  out.textContent += JSON.stringify(event.key)
}