Range
The <input> element with type="range" creates an input control that allows users to select a numeric value within a specified range by sliding a thumb control along a track.

<input type="range" class="form-range" id="customRange1" />
Explanation:
type="range"
: Specifies that the input should be rendered as a range slider.class="form-range"
: Bootstrap class that styles the range input to match the Bootstrap form styles.id="customRange1"
: Unique identifier for the input, used for associating the<label>
element with the input control.label
element: Provides a text description for the range input. Thefor
attribute of the<label>
element should match theid
attribute of the<input>
element to associate them correctly.
Additional Notes:
Attributes: You can use various attributes with
<input type="range">
such asmin
,max
,step
, andvalue
to define the range of values, increment step, and default value, respectively.JavaScript: You can use JavaScript to handle events like
input
orchange
to track changes made by users to the range input and perform actions based on those changes.Accessibility: Ensure that the range input is accessible by associating it with a
<label>
and providing meaningful text that describes its purpose.
Last updated