Jeff_Fairchild
Jeff_Fairchild
KPCKevin Powell - Community
Created by Jeff_Fairchild on 7/29/2023 in #front-end
Calculator not working on mobile
<script> const monthlyCharge = 297; // Set the monthly charge here document.getElementById("roi-calculator").addEventListener("submit", function (event) { event.preventDefault(); const clientValue = parseFloat(document.getElementById("client-value").value); const missedCalls = parseFloat(document.getElementById("missed-calls").value); const closeRate = parseFloat(document.getElementById("close-rate").value) / 100; const monthlyLeft = (clientValue * (missedCalls * closeRate) - monthlyCharge); const roi = (monthlyLeft / monthlyCharge) * 100; document.getElementById("monthly-left").textContent = monthlyLeft.toFixed(2); document.getElementById("we-charge").textContent = monthlyCharge.toFixed(2); document.getElementById("roi").textContent = roi.toFixed(2); }); </script>
2 replies