JSFiddle - React, Tailwind, and code Playground

by rofrol

HTML

<input type="text" />
<div>

</div>

JavaScript

document.querySelector('input').addEventListener("keydown", function (event) {
  document.querySelector('div').innerText = event.key || 'xd';
}, true);