HTML <input type="range">

Last Updated : 25 May, 2026

The HTML <input type="range"> element is used to create a slider control for selecting a numeric value within a specified range.

  • Used to select numeric values using a slider.
  • Created using <input type="range"> inside a form.
  • Supports attributes like min, max, step, and value.

Syntax:

<input type="range"> 

Example: Demonstrates the use of the HTML <input type="range"> element.

html
<!DOCTYPE html>
<html>

<head>
    <title>
        HTML Input Type Range
    </title>
</head>

<body style="text-align:center;">
    <h2>HTML &lt;input type="range"&gt;</h2>

    <form action="#">
        <label for="range_val">Select Range</label><br>
        <input type="range" id="range_val" value="60">
    </form>
</body>

</html>
Comment