JSFiddle - React, Tailwind, and code Playground

HTML

<div id="Div1">
    <input type ="text" id="aa"/>
    sdfsd hsjdhsj shdj shd sj</div>

JavaScript

$(function(){
$("#Div1 input").keypress(function (e) {
        if (e.keyCode == 13) {
            alert('You pressed enter!');
        }
    });
});