Browse By Name
HTMLCSSJavaScriptAppendix
You are here: Reference > JavaScript > client-side > HTML DOM > properties > min (input:range)

min property (input:range)

A A Font size Print Content Add new content Share Share
Browser support:
Sets or retrieves the minimum value of a range type input object (slider).
Use it together with the max and step properties.

Syntax:

object.min;
You can find the related objects in the Supported by objects section below.
This property is read/write.
HTML page for this property: min

Possible values:

String that sets or retrieves the value as an Integer, the minimum value of the slider.
Default: 0.

Example HTML code 1:

This example illustrates the use of the min attribute:
<input type="range" min="0" max="100" step="25" />
Did you find this example helpful? yes no

Example HTML code 2:

This example illustrates the use of the min property:
<head>
    <script>
        function SetMin () {
            var input = document.getElementById ("myInput");

            if (input.max !== undefined) {
                    //Opera
                input.min = 50;
            } else {
                    // only has effect in Safari
                input.setAttribute ("min", 50);
            }
        }
    </script>
</head>
<body>
    <input type="range" id="myInput" min="0" max="100" step="25" />
    <button onClick="SetMin ();">Allow 50 min!</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

User Contributed Comments

Post Content

Post Content