Most websites today have implemented the shortcut ctrl + enter on Linux and Windows or command + enter on Mac to submit text written in the textarea. Now this seems to be a mandatory shortcut for the web, making it easier to use submit from text that has been typed in the textarea. If you are a web developer and intend to implement it, here are the easy steps you can do.
More or less later the way it works is the same as the codepen preview below.
Codepen Preview
Explanation
As usual, using event listener on the textarea you want to go to. The event used is keydown, keydown is used because only this event supports e.metaKey on MacOS, which will detect if you press the command button.
e.ctrlKey will detect if the user press the control button on Linux or Windows.
e.metaKey will detect if the user press the command button on MacOS.
e.keyCode get the entire button number code, and 13 is the code for the Enter key,
this condition will also check whether there is a value in the textarea, if the value is filled, it will continue the next function to fill the content in the berid result element.