Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

HTML | min Attribute

  • Last Updated : 08 Dec, 2021

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 minimum value for an <input> element. 
    Syntax: 
     
<input min="number|date">
  • Example-1: This Example that illustrates the use of min attribute in input element. 
     

html




<!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>
  • Output: 
     

  • <meter>: When present in the meter element, it specify the minimum value for a gauge. 
    Syntax: 
     
<meter min="number">
  • Example-2: This Example illustrates the use of min attribute in a meter element. 
     

html




<!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>
    Laxman's score:
    <meter value="0.5" max="1.0" min="0" high="0.6">
        50% from 100%
    </meter>
</body>
 
</html>
  • Output: 
     

Supported Browsers: The browser supported by min Attribute are listed below: 

  • Google Chrome 5.0
  • Internet Explorer 10.0
  • Firefox 16.0
  • Opera 10.6
  • Safari 5.1

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!