🖼️Slider
Also known as Range Slider, Range Input
A handle you slide along a line. It picks a value, like how loud.
Think of it like
It is like a volume knob made straight. Slide it to turn things up or down.
Example
A hotel site uses a two-handle slider for price. Emma drags it to between $80 and $150.
Why it matters
It makes rough choices quick and shows where a value sits in its range.
Definition
Example code
html
<label for="vol">Volume</label>
<input id="vol" type="range" min="0" max="100">Try it
$10$200
A price range is a near enough question, which is what a slider is for.
Drag it. Now try to stop exactly on 37, which is why an exact number wants a box.
Common mistake
Key takeaways
- 1Drag to pick. Along a track.
- 2For rough values. Volume, brightness, price.
- 3Add a box for exact. Typing is precise.