Hey having a little trouble jquery and the hmtl5 range. I'm try to get the values as they changed but the event listener is not capturing it. Currently my code is:
HTML
html += '<li>Apply Credits: <input type="range" min="0" max="'+credits+'" name="discount_credits" id="discount_credits" /> <span>'+credits+'</span></li>'
And the JS is:
$('#discount_credits').mousewheel( function() { alert('it changed!'); alert('new value = ' + $(this).val()); });
I've also tried
$('#discount_credits').change( function() { alert('it changed!'); alert('new value = ' + $(this).val()); });
Neither seem to work. Am I doing something wrong?
$('input[type=range]').on('input', function () { $(this).trigger('change'); });
This fires the change
event on every input
event.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With