Hi, I'm learning JS, and I need help. Here is my code:
I truly appreciate the help, and realize this is probably the stupidest code you've all laid eyes on. I apologize, but one must start from SOMEWHERE.
//This object is going to be used
//so that at the end of the calcCost function,
//the client can see the subtotal, tax, and grandtotal
//in a portion of the webpage. Like a console, mayhaps.
var dataWindow=new Object();
//This is the function that takes the subtotal, tax and grandtotal and simply displays them in
//the data window.
return "Subtotal" + subtotal;
return "Tax" + tax;
return "Grandtotal" + grandtotal;
//This is the function that calculates the subtotal, tax and grandtotal.
var itemCost=prompt("Enter the cost of the item here.");
document.write("Subtotal" + subtotal);
document.write("Tax Charge" + tax);
document.write("Grand Total" + grandtotal);
dataWindow.showResults();//this call of the function should take the subtotal,tax and grandtotal
//and display them in the dataWindow.