My for loop is not working on my On-Click Event in javascript : i am facing an issue on for loop on a On-Click Event,
the Loop is always displaying me the last value.
can someone please help me here...

I have pasted the code below, in Array i got 10 values.
i have tried for loop and foreach, both are giving me same results

function getArray(){<br>
for(var i=0;i<Array_Name.length;i++){<br>
document.getElementById("p2").innerHTML=Array_Name[i];	<br>
}}
<br>

[ input type="submit" value="CalC" onclick="getArray()" ]

i want all the 10 values to be displayed on a button click event 

