diff --git a/static/js/chat.js b/static/js/chat.js index 93b7db2..7d35e8c 100644 --- a/static/js/chat.js +++ b/static/js/chat.js @@ -15,8 +15,12 @@ $(function(){ $("#alert").hide(); $("#stream").hide(); $("#uinputs").hide(); - $("#submit-username").click(authenticate); + $('#username').keydown(function (e){ + if(e.keyCode == 13 || e.keyCode == 32){ + authenticate(); + } + }) $("#submit-uinput").click(send); setupWS(); });