Javascript Ajax jQuery Html PHP Example Quiz New MORE
Need a Website Or Web Application.Contact : +91 9437911966 (Whatsapp) Note: Paid Service

How to calculate discount in jQuery

<!Doctype html>
    <script src=""></script>
    Price <input type="number" id="cBalance" value="">
    <br><br> %      <input type="number" id="chDiscount">
    <br><br> Result <input type="number" id="result">
        $(document).on("change keyup blur", "#chDiscount", function() {
            var main = $('#cBalance').val();
            var disc = $('#chDiscount').val();
            var dec = (disc / 100).toFixed(2); //its convert 10 into 0.10
            var mult = main * dec; // gives the value for subtract from main value
            var discont = main - mult;

Run it yourself