I wanted to make a program that the user would send 3 notes and after pressing "Calculate", you would be redirected to a page that would appear to your average. Who could help me:
function calcular()
{
var ac1 = parseInt(document.getElementById('ac1').value, 10);
var ac2 = parseInt(document.getElementById('ac2').value, 10);
var ac4 = parseInt(document.getElementById('ac4').value, 10);
var media = ((ac1*2)+(ac2*2)+ac4)/5;
alert("Sua média desta etapa foi "+media);
}
<html>
<head>
<style>
input {
margin-left: 100px;
width: 45px;
}
</style>
</head>
<body>
<form action="/teste1pag2" method="get">
Digite sua nota da Ac1 aqui: <input type="number" id="ac1" min="0" max="10"> <br>
Digite sua nota da Ac2 aqui: <input type="number" id="ac2"> <br>
Digite sua nota de participação aqui:
<input type="text" id="ac4" style="margin-left: 49px"> <br>
<input type="submit" onblur="calcular()" value="Calcular!">
</form>
</body>
</html>