I just wanted to thank all the people on here who have been helping me with JavaScript. I just had one more question.. Here is a part of the code so far.
function processGuess(){
var newLetters = /^[^A-Za-z]$/;
var lastLetters = document.getElementById("putGuessHere");
var finalGuess = lastLetters.value.toLowerCase();
if (newLetters.test(finalGuess)) {
document.getElementById("noNumbers").innerHTML = "you have to put in letters";
}
else if (wrongGuesses == finalGuess) {
alert("you already guessed that letter")
}
clearTimeout (guessTimeout);
guessTimeout = setTimeout("outOfTime();" , 5000);
}
<body onresize="setImageSize()">
<p>
<form action="">
<input type="button" id="newGame" value="Click Here To Start Game!" onclick="startGame();">
<br/>
<img id="thePicture" border="0" src="Images/Hangman0.jpg" width="300" height="300" alt="The hangman image">
<br/>
Type Your Next Guess Here:
<input type="text" id="putGuessHere">
<br/>
<input type="button" id="checkGuess" value="Check my Guess!" onclick="processGuess();">
<br/>
<br/>
</p>
</form>
<p id="secretWordDisplay" style="font-size:32pt;">
</p>
Wrong Guesses:
<p id="wrongGuesses" style="font-size:32pt;">
</p>
<p id="noNumbers" style="font-size:32pt;">
</p>
<p id="bestScore">
</p>
<p>
This web page has been tested in LIST THE BROWSER(S) HERE!!!!!
</p>
</body>
basically I have most of it working.. so far what happens is when the game starts a user chooses a word. for example "hello". After he/she types that in it becomes **** stars. The problem that i'm having is when the user inputs a letter for example "h" in the guess field and presses the guess button nothing happens. and I also need it to need the wrong guesses to go into a different paragraph or field. If anyone could help me with this I would really appreciate it. Thanks again!!
Bookmarks