this is my javascript which works for single input fields but I want it to work for multiple input.
here if I try to insert value for input class=adv more than fixed input value of class=full it won't allow
var $full = $('[class=full]');
var $adv = $('[class=adv]');
$adv.on('keyup keydown', function(e) {
var fullPay = parseInt($full.val(), 10);
var advPay = parseInt($adv.val(), 10); //tell the parser it is base 10
if (advPay > fullPay &&
e.keyCode !== 46 // keycode for delete
&&
e.keyCode !== 8 // keycode for backspace
) {
e.preventDefault();
$adv.val('');
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input type="number" name="full" class="full" value="5">
<input type="number" name="adv" class="adv" />