Joe Longstreet
Joe Longstreet

Reputation: 549

Step parameter for input type of range

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' />

Upvotes: 29

Views: 42257

Answers (3)

aWebDeveloper
aWebDeveloper

Reputation: 38352

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.

Upvotes: 38

SiamKreative
SiamKreative

Reputation: 126

If you want to make it work in Firefox 4+, you can use the following: HTML5Slider

Upvotes: 0

Cyclonecode
Cyclonecode

Reputation: 30031

The following works for me in chrome, I'm thinking that it's the shortcut step=".25" that won't work

 <input id="something" type="range" min="0" max="0" step ="0.25" value="5" />

Upvotes: 6

Related Questions