masteryamaha
Programmer
I have been made up this simple guessing game, i got bored, but it does not work, any help.
<head>
<title>Practice html </title>
<script type="text/javascript" language="javascript>
<!--
funtion Guess_game()
var rnum=Math.random()*20
var guess="GetElementById('guess')"
If (rnum == guess)
{document.write("Good Guess")}
else
{document.write("Try Again")}
-->
</script>
</head>
<body>
<form onload="Guess_game()" >
<input type="text" id="guess" />
<input type="button" name="Submit" value="submit" />
</form>
</body>
<head>
<title>Practice html </title>
<script type="text/javascript" language="javascript>
<!--
funtion Guess_game()
var rnum=Math.random()*20
var guess="GetElementById('guess')"
If (rnum == guess)
{document.write("Good Guess")}
else
{document.write("Try Again")}
-->
</script>
</head>
<body>
<form onload="Guess_game()" >
<input type="text" id="guess" />
<input type="button" name="Submit" value="submit" />
</form>
</body>