HTML | min Attribute

The HTML | min Attribute is used to specify the lower bound of the gauge, The value of min attribute must be less than the value of the max attribute. It has a default value which is 0. It can be used on both <input> and <meter> Element.

  • <input> When the min Attribute is present in the input Element, It specify the minium value for an <input> element.

    Syntax:

    <input min="number|date">

    Example-1: This Example that illustrates the use of min attribute in input element.

    filter_none

    edit
    close

    play_arrow

    link
    brightness_4
    code

    <!DOCTYPE html>
    <html>
      
    <body style="text-align:center;">
      
        <h1 style="color:green;"
                GeeksForGeeks 
            </h1>
      
        <h2>
          HTML | min Attribute in Input Field
      </h2>
        <form id="myGeeks">
            <input type="number"
                   id="myNumber"
                   step="5" 
                   name="geeks"
                   placeholder="multiples of 5"
                   min="10">
        </form>
        <br>
        <br>
        <p style="font-size:20px;">
          The minimum value for an
          input field is 10.
      </p>
    </body>
      
    </html>

    chevron_right

    
    

    Output:

  • <meter>: When present in the meter element, it specofy the minimum value for a gauge.

    Syntax:

    <meter min="numer">

    Example-2: This Example illustrates the use of min attribute in ameter element.

    filter_none

    edit
    close

    play_arrow

    link
    brightness_4
    code

    <!DOCTYPE html>
    <html>
      
    <head>
        <title>
          HTML | min attribute
      </title>
    </head>
      
    <body style="text-align:center;">
        <h1>GeeksforGeeks</h1>
        <h2>
          HTML | min Attribute:
      </h2> Sachin's score:
        <meter value="5" 
               min="0"
               max="10"
               high="6">
          5 out of 10
      </meter>
        <br>Laxma sxore:
        <meter value="0.5"
               max="1.0"
               min="0"
               high="0.6">
          50% from 100% 
      </meter>
    </body>
      
    </html>

    chevron_right

    
    

    Output:



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.