<html>
<head>
<script type="text/javascript">
function gameThing() {
var num = Math.round(Math.random()*1001)
var counter= document.form.b.value
var text= document.form.a.value
if (text==num) {
document.form.c.value='You got it! How did you know that number? You
Guessed the number through' ' ' counter ' ' 'guesses'
}
if (text<num) {
document.form.c.value='That is too low!'
}
if (text>num) {
document.form.c.value='That is too high!'
}
}
function refreshPage() {
history.go()
}
function counTer() {
document.form.b.value ;
}
</script>
</head>
<body>
<br/><br/><br/><br/><br/><br/><br/><br...
<div align="center"><p>Ok input a number then click submit, if it is
too high the message will say too high, same with too low, keep trying
until oyu get it!</p>
<br/><br/><p>Click Refresh to get a new number.</p><br/><br/>
<form name="form">
<input type="text" name="c" size=100 />
<br/><br/><br/>
<input type="text" name="a" size=4 />
<input type="button" value="submit" onClick="gameThing(); counTer();" />
<input type="button" value="Refresh" onClick="refreshPage()" />
<br/><br/><input type="text" value=0 name="b" size=4 />
</div>
</form>
</body>
</html>
Tags: