Here is the fixed code:
-
<html>
-
<head>
-
<script language="javascript">
-
-
function textNum(){
-
var r = Math.floor(Math.random()*10);
-
var A = document.getElementById('enterno').value;
-
-
if ( r > A)
-
{
-
document.getElementById('rem').value = "higher";
-
}
-
else if (r < A)
-
{
-
document.getElementById('rem').value = "lower";
-
}
-
else if(r == A)
-
{
-
document.getElementById('rem').value = "equal";
-
}
-
}
-
-
function checkbrowser() {
-
var x = navigator
-
alert("CodeName=" + x.appCodeName + '\n' + "Name=" + x.appName + '\n' + "Version=" + x.appVersion)
-
}
-
</script>
-
</head>
-
-
<body>
-
<table width="364" border="1">
-
<tr>
-
<td colspan ="2">Guess the Number</td>
-
</tr>
-
<tr>
-
<td>Enter a Number from 1 - 10:</td>
-
<td>
-
<input type="text" id="enterno" name="enterno"/> </td>
-
</tr>
-
<tr>
-
<td>Check Remarks Here:</td>
-
<td>
-
<input type="text" id="rem" name="rem"/>
-
</td>
-
</tr>
-
<tr>
-
<td colspan="2"> <form>
-
<input type="button" value="Test The Number" onclick = "textNum()"/>
-
<input type="button" value="Try Again" onclick = "try()"/>
-
<input type="button" value="Check Browser" onclick = "checkbrowser()"/>
-
</form></td>
-
</tr>
-
</table>
-
</body>
-
</html>
-
On the last else statement you were missing an if command and the following code wasn't necessary
-
var higher = r>A;
-
var lower = r<A;
-
var equal = r=A;
-
The above code was essentially telling the script that the random number should be equal to the input number regardless of the use of the random generator above.
Hope that helped. :)