JSFiddle - React, Tailwind, and code Playground

HTML

<input id="input-1" type="text">

JavaScript

$("#input-1").keydown(function (e) {
    if (e.keyCode == 13) {
        alert("enter pressed");
        e.preventDefault();
    }
});