var sav =new Array();
sav[] =prompt("Enter value");
while(a!="x")
{
var a =prompt("Enter value");
sav[a]=a;
}
if(a==x)
document.write(sav[a]);
How Get value of JS promptbox then save into Array help...!
var x = prompt("enter number"); sav.push(x)sav[] = xis not valid JavaScript syntax. I believe you're looking forsav.push(x). However, from this code, it's difficult to guess what you're actually trying to accomplish. Please clarify your question.