Enter a number or a string:

SOURCE CODE:
<form name="MyForm">
Enter a number or a string: <input type="text" name="TestValue">
<input type=submit value="Test Value" onClick="testit();">
</form>
<script language="javascript">
function testit(){
   var strToTest=document.MyForm.TestValue.value
   document.write("strToTest=<b>"+strToTest+"</b> is ");
   var strNumber=isNaN(strToTest);
   if (strNumber==true) {
      op="<b>not a Number.</b> <br>NOTE: isNaN(strToTest)"
      op=op+" is TRUE<br>isNaN means <i>is not a number</i>"
      document.write(op);
   }
   else {
      op="<b>a Number.</b> <br>NOTE: isNaN(strToTest)"
      op=op+" is FALSE<br>isNaN means <i>is not a number</i>"
      document.write(op);
   }
}
</script>