JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" onkeypress="alert('whoops, I was triggered!');"/>
<div>click me</div>
CSS
div{
width: 100px;
height: 100px;
background-color: red;
position: absolute;
left: 50px;
top: 50px;
}
JavaScript
$(function(){
$('div').bind('click', function(){
$('input').trigger({
type: 'keypress',
which: 13
});
});
});