JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="hoge" />
<input type="text" id="op" value="0" />

JavaScript

$(document).ready(function() {
  $('#hoge').keydown(function() {
    var count = parseInt($( '#op' ).val());
    count = count + 1;
    $('#op').val(count);
  });
});