0

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!

1

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.