When the user hits the cancel button in the veryfirst prompt window I would like the JS program to close and for there to be just the internet browser open. How would I go about doing this. I have tried several things but none seem to work.
Thanks for any help.
Here is the code:
<!–
var comstock = window.prompt(“How Many Company Stock Owned? Enter#1-10″,””);
while(comstock<1||comstock>10){comstock=window.prompt(“invalid number re-enter”,””);}
var sellArray = new Array(comstock);
var costArray = new Array(comstock);
var symbolArray = new Array(comstock);
var sellingPrice;
var cost;
var symbol;
var i = 0;
while (i < comstock)
{
symbol = window.prompt(“Symbol for Company Stock?”,””);
cost = window.prompt(“Cost of Company Stock?”,””);
sellingPrice = window.prompt(“Selling Price of Company Stock?”,””);
symbolArray[i] = symbol;
costArray[i] = cost;
sellArray[i] = sellingPrice;
i++;
}
for(x = 0; x < comstock;x++){
var answ = costArray[x] – sellArray[x];
if(answ < 0)
document.write(“<font color=’red’>”);
if(answ >= 0)
document.write(“<font color=’blue’>”);
document.write(symbolArray[x] + “: ” + answ + “<br>”);
}
//–>