-
-
Save pareshchouhan/49028de0d82dbe51d3ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#nick').keypress(function(event){ | |
if ( event.which == 13 ) { | |
var nick = $(this).val(); | |
if (nick == '') | |
$(this).val('YOLO' + parseInt(Math.random() * 100 + 0 )); | |
nick = $(this).val(); | |
client.name = nick; | |
$('#nickname').css('visibility','hidden'); | |
$('form').css('visibility','visible'); | |
$('#nick').unbind('keypress'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment