My goal is to make a code with javascript in which when entering a number in a field, it shows me a message with the student's grade. The code is as follows:
function calcular() {
var 1 = 100;
var 2 = 90;
var 3 = 80;
var 4 = 70;
var 5 = 60;
var nota = document.getElementById('nota').value;
if (nota <
var 1) {
document.write("parametro invalido")
}
if (nota <
var 2) {
document.write("Examen Excelente")
}
if (nota <
var 3) {
document.write("Examen muy bueno")
}
if (nota <
var 4) {
document.write("Examen bueno")
}
if (nota <
var 5) {
document.write("Examen regular")
}
if (nota >
var 5) {
document.write("Desaprobado")
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>conversor</title>
</head>
<body>
<input type="number" name="nota" id="nota">
<button onclick="calcular()">calcular</button>
</body>
</html>