JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<p>In this example, the text field gets focus immediately after the document window has been loaded.</p>
<textarea id="myText"> </textarea>
JavaScript
$(function() {
$('#myText').keypress(function(){
alert("test");
});
$('#myText').trigger(jQuery.Event('keypress', { keyCode: 65 }));
});