Hangman game using javascript