I need a function to be called when the slider knob has been released.
onchange
changes the value while I'm changing it. Is there a solution for this like
<input type="range" min="0" max="1000" onrelease="callfunction()">
Use the mouseup
event on desktop browsers and the touchend
event on mobile phones for handling this user interaction.
<input type="range" min="0" max="1"
onmouseup="callfunction()"
ontouchend="callfunction()">
I would recommend to check caniuse.com for browser support.
Known issues (as of 2019-03-25):
tomhughes makes a good point re: accessibility.
It's possibility to add onkeyup
to the list:
<input type="range" min="0" max="1"
onmouseup="callfunction()"
ontouchend="callfunction()"
onkeyup="callfunction()"
>
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