Open In App

HTML | <input> minlength Attribute

Last Updated : 12 Aug, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

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 40
  • Edge 17
  • Firefox 51
  • Apple Safari 10.1
  • Opera 27

 


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads