Create a script that presents a word-guessing game. Allow users to guess the word one letter at a time by entering a character in a form. Start by assigning a secret word to a variable. After each guess, print the word using asterisks for each remaining letter, but ?ll in the letters that the user guessed correctly. Store the user’s guess in a form ?eld. For example, if the word you want users to guess is “suspicious” and the user has successfully guessed the letters “s” and “i,” then store
s*s*i*i**s in the form ?eld. You need to use multiple arrays along with the split() and join() methods to create the game’s functionality.
Clear the guessed character from the form each time it is submitted, and add functionality that displays an alert dialog box if the user fails
to enter a character. Save the document as GuessingGame.html.