JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="key">
JavaScript
$(function () {
$('#key').on('keydown', function (event) {
console.log(event.which);
});
});
<input type="text" id="key">
$(function () {
$('#key').on('keydown', function (event) {
console.log(event.which);
});
});