HTML - attributes - min

revision:


Content

"min" attribute : specifies the minimum value of an element syntax some examples


"min" attribute : specifies the minimum value of an element

top

The min attribute can be used on the following elements : <input> and <meter>.
When used together with the <meter> element, the "min attribute" specifies the lower bound of the gauge. The value must be less than or equal to the value of the "max attribute". If a value is specified for the "min attribute" that isn't a valid number, the input has no minimum value.


syntax

top

<input min=" ">

<meter min=" "></meter>

Valid for the numeric input types, including the date, month, week, time, datetime-local, number and range types, and the <meter> element, the min attribute is a number that specifies the most negative value a form control considers to be valid.


some examples

top






codes:
                    <form style="margin-left:5vw;" action="/action_page.php">
                        <label for="datemax">Enter a date before 1980-01-01:</label>
                        <input type="date" id="datemax" name="datemax" max="1979-12-31"><br><br>
                    
                        <label for="datemin">Enter a date after 2000-01-01:</label>
                        <input type="date" id="datemin" name="datemin" min="2000-01-02"><br><br>
                    
                        <label for="quantity">Quantity (between 1 and 5):</label>
                        <input type="number" id="quantity" name="quantity" min="1" max="5"><br><br>
                    
                        <input type="submit">
                    </form>
                

codes:
                    <p class="spec"><label for="anna">Anna's score:</label>
                    <meter id="anna" min="0" low="40" high="90" max="100" value="95"></meter></p>
                            
                    <p class="spec"><label for="peter">Peter's score:</label>
                    <meter id="peter" min="0" low="40" high="90" max="100" value="65"></meter></p>
                            
                    <p class="spec"><label for="linda">Linda's score:</label>
                    <meter id="linda" min="0" low="40" high="90" max="100" value="35"></meter></p>