here is the code, it is supposed to calcualte the total of the books and display them but when displayed all i get is NAN (only works in ie). This is part of my course work so please help
<html>
<head>
<title>Arrays</title>
<script type=”text/javascript”>
function show_prompt(){
document.write(“<h2>Arrays</h2>”)
var book = new Array()
for (a = 0; a <= 10; a++){
book[a]=prompt(‘Enter book name’)
}
var price = new Array()
for (i = 0; i <= 10; i++){
price[i]=prompt(‘Enter price of item named :’+book[a]);
document.write(‘ <b>Name:</b> ‘+ book[a] + ” <b>Price:</b> “+price[i]+'<br/>’);
}
var total = parseFloat(price[i]);
document.write( ‘total:’ + total + ‘<br/>’)
}
</script>
</head>
<body onload = “show_prompt()”>
</head>
</html>