Function show()

Hi,
Ive come up with this but I couldn’t get the numbers to display in the text field?
:slight_smile:
Any ideas where i should start.

<script type=“text/javascript”>

var numbers = new Array();

function insert(val)
{
numbers[numbers.length]= parseFloat(val);
}

function show()
{
var string=“aa”;
for(i = 0; i < numbers.length; i++)
{string=string+numbers[i]+"
"}
}
alert(string);
document.getElementById(“e”).value = string;

function sum(numbers)
{
if (numbers.length == 0)
for (i=0; i <array.length; i++)

document.getElementById(“Sum”).value = total += numbers[i];return total;
}

function mean(numbers)
{
return numbers.length == 0 ? 0 : sum(numbers)/numbers.length;

document.getElementById(“answer”) = mean(numbers).value;
}

</script>

I think this should be continued in your other post as the above won’t work at all.