JSFiddle - React, Tailwind, and code Playground

HTML

<html>

<input type='button' name='x' value='Button'/>

</html>

JavaScript

function stuff(e) { alert('Something happened'); }

$('input[type=button]').click(function(e) { 
    stuff(e);
});

$(document).keydown(function(e) { 
    if (e.keyCode == 39) { stuff(e); }
});