JSFiddle - React, Tailwind, and code Playground
HTML
<button id="random" onclick="alert('clicked 0');">Check</button>
<button id="random2" onclick="alert('clicked 1');">Something else</button>
<button id="random3" onclick="alert('clicked 2');">Third Button</button>
JavaScript
$(
function(){
$(document).keydown(function(){
if (event.keyCode == '13') {
event.preventDefault();//stop what normally happens..
//..like submitting a form maybe
//$("input[type='submit'][value='Check']").click();
$("button").each(function(){
if($(this).text() == "Check")
{
$(this).click();
}
})
}
});
}
);