JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" size="10" id="loginUserID" name="username">
<input type="button" value="Login" name="loginBtn" id="loginBtn">

JavaScript

$('#loginUserID').keypress(function(event){
  if(event.keyCode == 13){
    $('#loginBtn').click();
  }
});

$('#loginBtn').click(function(){
   alert('button was "clicked"'); 
});