how to get user input in javascript and get sum
<script>
var tot = 0;
var mark = 0;
var avg = 0;
for(i=1; i<=5; i++)
{
Mark = prompt("Enter "+i+" mark below","");
tot = Number(tot)+Number(Mark);
}
avg = tot/5;
document.write("Sum is: "+tot);
document.write("<br>Average is: "+avg);
</script>