JSFiddle - React, Tailwind, and code Playground

HTML

<form action="" name="exemplo" method="POST">
  <input type="text" accesskey="s" name="texto_exemplo"/>
</form>

JavaScript

$('input[name="texto_exemplo"]').keypress(function (e) {
  if (e.which === 32) {
    if($('form[name="exemplo"]').submit()){
      alert("Formulário enviado!");
    }
    return false;
  }
});