Skip to content
Related Articles

Related Articles

HTML | <input> minlength Attribute

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 28 Feb, 2022

The HTML <input> minlength Attribute is used to define <input> minlength Attribute. the Integer value must start with 0 or higher. 
Syntax: 
 

< input minlength="numeric"> 

Attribute Value: 
 

  • number: It contains the numeric value i.e 0 or higher.

Example: 
 

html




<!DOCTYPE html>
<html>
 
<body>
    <center>
        <h1 style="color:green;">
        GeeksForGeeks
        </h1>
        <h2>
        minlength attribute
        </h2>
        <form action="">
            Username:
            <input type="text"
                   name="username"
                   minlength="10">
            <br>
            <br> Password:
            <input type="text"
                   name="password"
                   maxlength="10">
            <br>
            <br>
            <input type="submit"
                   value="Submit">
        </form>
    </center>
</body>
 
</html>

Output: 
 

Supported Browsers: The browsers supported by <input> minlength Attribute are listed below: 
 

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Apple Safari
  • Opera

 

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!