Disable incrementation of input type number

I got bunch of number typed inputs. I want to disable incrementation if the sum of all inputs reaches certain amount of number, lets say max_limit with jquery or javascript.

max_limit changes according to user input so it is not a fixed number and I have more than one inputs, incrementation should stop if sum of all input values reaches max.

I couldnt figure out how to do it.

jQuery("input[type=number]").click(function(e) {

if (jQuery(this).val() == mult_final) {
e.preventDefault();
} else {

} });

Not only this doesnt work, this idea only checks one input and disables one input..