Issue
I have a slider that I want to get the step value of with jQuery. I can manually find the step value in HTML but if I change it in the future, I would prefer not to do the same in other files too.
By step value I mean step="0.05" from the slider input below:
<input id="slider" type="range" min="0" max="10" value="5" step="0.05">
Solution
You can use attr on your slider
var step = $('#slider').attr('step')
// step will be '0.05'
an example your code working with jquery 3.5
Answered By - Gianluca Musa
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.