JSFiddle - React, Tailwind, and code Playground

HTML

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

JavaScript

$("button").click(function() {
     $("input").focus();
    var e = jQuery.Event("keydown");
    e.which = 77; // # Some key code value
    $("input").trigger(e);
})