Loi Nguyen Huynh
Loi Nguyen Huynh

Reputation: 9938

How to update value of input type=range

Why in my playbackChange function, the value doesn't update as expected? https://jsfiddle.net/zestrdj7/. I don't know if there's something wrong with the way I update the input[type="range"], or anything with float number/ value type?

Reproduce the problem by pressing [ or ], I expect the playbackProgress.value decrement/increment by 0.1 each press, but it's stuck at 1.3/2.

Upvotes: 3

Views: 60

Answers (1)

kennyvh
kennyvh

Reputation: 2854

It is because playbackProgress.value and playbackProgress.step are strings.

You can convert them into numbers using parseFloat.

Upvotes: 1

Related Questions