JSFiddle - React, Tailwind, and code Playground

HTML

<form id="form">
    <input type="text" class="theInput" name="theInput" />
    <input type="submit" value="submit" />
</form>

JavaScript

$("input[type='submit']").click(function(event){
    if (event.screenX === 0) alert("You hit the enter key!");
    else alert("You clicked the submit button!");
    
    return false; // Allows me to read the console before the form submits!
});