JSFiddle - React, Tailwind, and code Playground

HTML

<textarea id="foo"></textarea>

JavaScript

document.getElementById('foo').onkeypress = function (e) {
    if (e.keyCode === 13) {
        alert('submitting');
    }        
};