Find jobs - Debt Consolidation - Arcade Games - Prefessional Book Reviews - WoW Gold

PDA

View Full Version : how to get those values and push them in to array using loop


val75
Dec 23rd 2008, 4:57 am
Hi.
I'm very new with programming, and I struggle with a part of script
How can I get those values and push them in to array using loop???
<script>
var a = prompt("a");
var b = prompt("b");
var c = prompt("c");

var arr=new Array(3);
arr[0]=a;
arr[1]=b;
arr[2]=c;
<script>
Thanx

val75
Dec 23rd 2008, 7:31 am
var arr=new Array(3);
for(i=0;i<3;i++){
arr[i]=prompt("get "+i);
}
document.write(arr);