HTML - attributes - max

revision:


Content

"max" attribute : specifies the maximum value of an element syntax some examples


"max" attribute : specifies the maximum value of an element

top

The max attribute can be used on the following elements:<input>, <meter>, <progress>.
When used by the <progress> element, the max attribute specifies how much work the task requires in total.


syntax

top

<input max="number">

<meter max="number"></element>

<progress max="number"></element>


some examples

top






codes:
                    <form style="margin-left:3vw;" 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>
                
32%
codes:
                    <label style="margin-left:3vw;" for="file">Downloading progress:</label>                                  
                    <progress id="file" value="32" max="100"> 32% </progress>