btn.on('click', function() { //if value < max $("#slider").val(your_val); $("#slider").trigger('change'); });