jquery - changing bg color on min and max -
i want change color of button-down , button-up when spinner have min or max value red <input type="hidden" name="id" value="<?= $this->product->getid() ?>" /> <input name="quantity" value="1" readonly/> <script type="text/javascript"> $(document).ready(function () { $('input[name="quantity"]').spinner({ min: 1, max: <?= $this->product->getquantity() ?>, }).keydown(function (e) { e.preventdefault(); }); }); </script> you can apply change method jquery ui spinner provides: $('input[name="quantity"]').spinner({ min: 1, max: <?= $this->product->getquantity() ?>, spin:function(event, ui){ $(this).closest('.ui-spinner').find('a.ui-spinner-button').css('background', function(){ ...