Is it possible to specify a decimal for a step parameter within the range element? According to a few articles I've read, including one on Nettuts, this should be possible. This does not appear to be working in any browsers. I've tried Chrome, Safari, and mobile Safari. Am I misunderstanding simple here, or is this just not supported quite yet?
<input id='something' type='range' min='0' max='20' step='.25' value='5' />
The step attribute specifies the interval between legal numbers in an <input> element. Example: if step="3" , legal numbers could be -3, 0, 3, 6, etc. Tip: The step attribute can be used together with the max and min attributes to create a range of legal values.
The <input type="range"> defines a control for entering a number whose exact value is not important (like a slider control). Default range is 0 to 100. However, you can set restrictions on what numbers are accepted with the attributes below. Tip: Always add the <label> tag for best accessibility practices!
The default is 0. The value won't be greater than max . The default is 100. The value will be a multiple of step .
http://jsfiddle.net/Df57B/
Check out this demo it is possible to give steps in decimal.
<input type="range" name="points" min="1" max="10" step="0.25" onchange="alert(this.value)"/>
Your mistake take is that you gave .25 instead of 0.25.
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