So then am I replacing the document.forms with document.getElementsByName("usedLetters") (the parts in bold)? I tried that, it didn't seem to work, so I'm guessing that's not right...?
I totally understood my code when using a text input, but after I decided to put buttons instead, my confusion...
So I'd be changing the script inside the body to:
<script>
for (i=0; i<28; i++) {
document.write("<input type=text name=usedLetters size=1>")
}
</script>
and
<script>
for (i=0; i<word.length; i++) {
document.write("<input type=text size=5...
Here's a link to the original code and the new code that I'm trying to get to work:
http://www.public.asu.edu/~ddinsmor/hangman.html
http://www.public.asu.edu/~ddinsmor/hangman_2.html
Here's what I have so far:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Derek Dinsmore's...
Interesting, I hadn't even thought of that!
It seems to work now, though it still doesn't register anything in the text boxes I've made. Instead of saying "Undefined" now, it just duplicates whatever button I press by replacing another one with that letter. I'm sure it's something easy I'm...
Hello, this is my first post here, but I'm having some trouble figuring out what I messed up on my code :(
I'm making a Javascript game of Hangman for one of my classes and I originally had the input as a text box where you physically type in the letter and if it was wrong, it would draw the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.