JSFiddle - React, Tailwind, and code Playground

HTML

<input id="key"/>

JavaScript

input = document.getElementById("key");
input.onkeyup = (e) => {
if(e.keycode = 13) {
console.log("Hello you pressed Enter")
}
}