JSFiddle - React, Tailwind, and code Playground

HTML

<input id="test" type="text" />

JavaScript

e = jQuery.Event("keypress")
e.which = 13 //choose the one you want
    $("#test").keypress(function(){
     alert('keypress triggered')
    }).trigger(e)