boy man
boy man

Reputation: 111

Adding a slider to html

I want to add a slider as in input on a web page I am designing. I don't even know if it is called a slider.

Upvotes: 0

Views: 52

Answers (1)

Victor Salmon
Victor Salmon

Reputation: 53

A "slider" is written like this but within <> tags:

<input type="range" min="5" max="10" step="0.01">

You can set step to 1 and set the minimum and maximum values however you want. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/range

If you're looking for two sliders, you can build it out of two sliders like this:

<input value="500" min="500" max="50000" step="500" type="range">
<input value="50000" min="500" max="50000" step="500" type="range">

https://codepen.io/rendykstan/pen/VLqZGO

Upvotes: 1

Related Questions