Answers for "how to calculate balance automatically using javascript and php using cash paid"

PHP
0

how to calculate balance automatically using javascript and php using cash paid

<!Doctype html>
<html>
<body>
    <input id="price">Price
    <br><br>
    <input id="discount">%
    <br><br>
    <button onclick="getPrice()">
Get total
</button>
    <br><br>
    <input readonly id="total">
    <script>
        getPrice = function() {
            var numVal1 = Number(document.getElementById("price").value);
            var numVal2 = Number(document.getElementById("discount").value) / 100;
            var totalValue = numVal1 - (numVal1 * numVal2)
            document.getElementById("total").value = totalValue.toFixed(2);
        }
    </script>
</body>
</html>
Posted by: Guest on May-28-2020

Code answers related to "how to calculate balance automatically using javascript and php using cash paid"

Browse Popular Code Answers by Language