
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
How to give a limit to the input field in HTML?
The HTML <input> tag is used to get user input in HTML. To give a limit to the input field, use the min and max attributes, which is to specify a maximum and minimum value for an input field respectively.
The max and min attributes are used with number, range, date, datetime, datetime-local, month, time and week input types.
Example
You can try to run the following code to give a limit to the input field in HTML −
<!DOCTYPE html> <html> <head> <title>HTML input number</title> </head> <body> <form action = "" method = "get"> Mention any number between 1 to 10 <input type="number" name="num" min="1" max="10"><br> <input type="submit" value="Submit"> </form> </body> </html>
- Related Articles
- How to limit the number of characters allowed in form input text field?
- How to include an input field in HTML?
- How to use input type field with date field in HTML?
- How to limit an HTML input box so that it only accepts numeric input?
- How to use input type field with steps in HTML?
- How to disable autocomplete of an HTML input field?
- How to use a textarea (a multi-line text input field) in HTML?
- How to use input type field with the color picker in HTML?
- How do we add a single-line input field in HTML?
- How to limit input text length using CSS3?
- How to limit maximum items on multiple input ()?
- How to limit the amount of characters returned from a field in a MongoDB?
- How to limit character input in textarea including count in jQuery?
- How to limit the amount of characters returned from a field in a MongoDB query?
- MongoDB query to limit the returning values of a field?

Advertisements