HTML <input type=”range”>

The HTML <input type=”range”> element creates a slider control for selecting a value from a specified range. Users can move the slider to choose a value between a defined minimum and maximum. This element is often used for adjusting settings like volume, brightness, or other numerical values in web forms. Its default range value is from 0 to 100. 

Syntax

<input type="range"> 

Example: This 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>

Output

Supported Browsers

  • Chrome 4
  • Edge 12
  • Firefox 23
  • Opera 11
  • Safari 3.1

Contact Us