
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
HTML DOM Input Range min property
The HTML DOM Input Range min property is used for setting or returning the min attribute value for the range slider control. This attribute is used for indicating the minimum value of the slider control and is often used with min property to create a range of values between which the slider can move.
Syntax
Following is the syntax for −
Setting the Range min property −
rangeObject.min = number
Here, number represents minimum slider control value.
Example
Let us look at an example for the Input range min property −
<!DOCTYPE html> <html> <body> <h1>Range min property</h1> <form> VOLUME <input type="range" id="RANGE1" name="VOL" min="15"> </form> <p>Get the minimum value for the above slider by clicking the below button.</p> <button type="button" onclick="minVal()">GET MIN</button> <p id="Sample"> </p> <script> function minVal() { var R=document.getElementById("RANGE1").min; document.getElementById("Sample").innerHTML = "The minimum value for this range slider is "+R; } </script> </body> </html>
Output
This will produce the following output −
On clicking the GET MIN button −
In the above example −
We have created an input field contained inside a form having type=“range”, id=“RANGE1”, name=“VOL” and min attribute value set to 15 −
<form> VOLUME <input type="range" id="RANGE1" name="VOL" min="15"> <form>
We have then created a button GET MIN that will execute the minVal() method when clicked by the user −
<button type="button" onclick="minVal()">GET MIN</button>
The minVal() method uses the getElementById() method to get the input field with type range and get its min attribute value. The returned value which signifies the minimum value the slider can have is then assigned to variable R. This value is then displayed in the paragraph with id “Sample” using its innerHTML property −
function minVal() { var R= document.getElementById("RANGE1").min; document.getElementById("Sample").innerHTML = "The minimum value for this range slider is "+R; }
- Related Articles
- HTML DOM Input Month min Property
- HTML DOM Input Number min Property
- HTML DOM Input Date min Property
- HTML DOM Input Datetime min Property
- HTML DOM Input DatetimeLocal min Property
- HTML DOM Input Time min Property
- HTML DOM Input Week min Property
- HTML DOM Input Range autofocus property
- HTML DOM Input Range disabled property
- HTML DOM Input Range form property
- HTML DOM Input Range max property
- HTML DOM Input Range name property
- HTML DOM Input Range step property
- HTML DOM Input Range type property
- HTML DOM Input Range value property
