Toma, el ejemplo funcionando:
Código HTML:
<html>
<head>
<script>
function MiraNota()
{
if(document.form1.nota.value < 5)
{
document.write("Suspenso"); return false;
}
else if(document.form1.nota.value < 7)
{
document.write("Aprobado"); return false;
}
else if(document.form1.nota.value < 9)
{
document.write("Notable"); return false;
}
else
{
document.write("Sobresaliente"); return false;
}
}
</script>
</head>
<body>
<form name="form1" method="post" action="">
<p>
<input name="nota" type="text" id="nota" maxlength="4">
<input name="Submit" type="button" onClick="MiraNota()" value="Consultar">
</p>
</form>
</body>
</html>