Javascript find the average from user's input using array?


This is my code:

<head> Grade Average
<title> </title>
function dosomething
  var i = Number;
 var numbers = new Array{a,b,c};
        numbers[0] = a;
        numbers[1] = b;
        numbers[2] = c;

 var total=0;
    for (i=0; i<=numbers.length()-1; i++) 
    { total += numbers[i];
     var avg = total/numbers;
    document.getElementById("functionOutput").innerHTML = numbers[i];
     <p id= "functionOutput"></p>
    <input type="text" id="input" />
    <input type= "button" id="enter" onclick="dosomething(input.value)" 
    value="Calculate" />


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.