JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="txt"/>

JavaScript

$('#txt').keydown(function (e){
    if(e.keyCode == 13){
        alert('you pressed enter ^_^');
    }
})