I am having an issue with my total_price function. I have tried to implement it in the totalPrice paragraph that I previously created, but it does not display.
function calcAdult()
{
var ticketPrice = 12;
var amount = document.getElementById('SAinput').value;
var total = ticketPrice * amount;
document.getElementById('SAPrice').innerHTML = "Cost = $" +total.toFixed(2);
return total;
}
function calcCon()
{
var ticketPrice = 10;
var amount = document.getElementById('SPinput').value;
var total = ticketPrice * amount;
document.getElementById("SPPrice").innerHTML = "Cost = $" +total.toFixed(2);
return total;
}
function total_price()
{
var price = calcAdult() + calcCon();
document.getElementById("totalPrice").innerHTML = "Cost = $" + price.toFixed(2);
}