I'm trying to make a program where the user can enter how many CD's they wish to enter and then print out what they have entered onto a screen.
Is there a way to enable multiple entries from one prompt box?
<script language="JavaScript">
var titleCD = [];
var costCD = [];
var subTotal = [];
var entries = parseInt(prompt("How many CDs do you wish to enter?",0));
while(entries>0) {
titleCD = prompt("What is the title of your CD?");
costCD = parseInt(prompt("What is the cost of that CD?", 0));
entries--;
}
b = new String(titleCD + ": " + "£" + costCD + "<br>");
document.write(b.bold());
u = new String("The subtotal cost of all CDs is: £" + subTotal);
document.write(u.toUpperCase());
</script>