Reputation: 209
I'm using the jQuery slider to change the value of an input.
div#slider
input#amount
I use the value of the input to perform some math with:
$("input#amount").change(function() {
...
The thing is, when I enter some value in the input, it works fine, but playing with the slider, the value appears to change, but no calculation is performed.
jsfiddle: http://jsfiddle.net/mfeqoL7L/
Why/How to fix this?
Thx!
Upvotes: 0
Views: 700
Reputation: 34288
The problem is that setting a value on an input element using .val
doesn't fire the change
event: Why does the jquery change event not trigger when I set the value of a select using val()?
To manually fire the event call .change
explicitly after setting the .val
.
Upvotes: 1