JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" />
<textarea></textarea>

JavaScript

$(function(){
    $('input, textarea').on('keypress', function(e){
        
        if (e.keyCode == 13) {
            e.preventDefault();
			alert('Apertou Enter!');
        }
//        
    });
});