JSFiddle - React, Tailwind, and code Playground

by techiedelight

HTML

<p>
Press Enter key!
</p>

JavaScript

document.addEventListener("keyup", function(event) {
  if (event.code === 'Enter') {
    alert('Enter is pressed!');
  }
});