Jquery stop calculation using this : <p>I am trying to make some calculations between inputs , I have 7 inputs and what I want to do is making calculations between them , so this is my code </p>

<pre><code>      $('.empCosts').on('input', function () {
        var perHour = parseInt($('#per_hour').val());
        var hours = parseInt($('#hour').val());
        var perDay = parseInt($('#per_day').val());
        var days = parseInt($('#day').val());
        var perMonth = parseInt($('#per_month').val());
        var month = parseInt($('#months').val());
        var perYear = parseInt($('#per_year').val());
        var perdayVal = parseInt(perHour * hours);
        var perMonthVal = parseInt(perDay * days);
        var perYearVal = parseInt(perMonth * month);
        var perHourVal = parseInt(perDay / hours);
        var perMonthDivide = parseInt(perYearVal / month);

        $("#per_day").val(perdayVal);
        $("#per_month").val(perMonthVal);
        $("#per_year").val(perYearVal);
        $("#per_hour").val(perHourVal);
        if($(this).is(":focus")){
            alert('sdfasdfad');
        }
    });
</code></pre>

<p>these inputs should be connected either you multiply or divide , when I try to change per_day value it doesn't change because I already set the value of that input with var <code>perdayVal = parseInt(perHour * hours);</code>, I want either you increase the number or decrease it , it should make the calculation either multiplying or dividing the inputs, here you have the fiddle</p>

<p><a href="https://jsfiddle.net/2jb2e3Lv/" rel="nofollow noreferrer">DEMO</a></p>
