
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How do we add the maximum number of characters allowed in an element in HTML?
Use the maxlength attribute to add the maximum value in HTML. You can try to run the following code to implement maxlength attribute −
Example
<!DOCTYPE html> <html> <body> <form action = ""> Rank: <input type = "number" name = "rank" min = "1" max = "10"><br> Cricketer: <input type = "text" name = "cricketer" maxlength = "20"><br> <input type = "submit" value = ”Submit”> </form> </body> </html>
- Related Questions & Answers
- How do we add extra information about an element in HTML?
- How do we add the width in characters for <input> in HTML?
- How do we display the thickness of the border of an element in HTML?
- How do we set the type of element in HTML?
- How do we add glossary definitions in HTML?
- How do we add bold text in HTML?
- How do we add document title in HTML?
- How do we set the text direction for the content in an element in HTML?
- How do we add a comment in HTML code?
- How do we add a definition term in HTML?
- How do we add a noframe section in HTML?
- How do we add a noscript section in HTML?
- How do we add a menu list in HTML?
- How do we add a table row in HTML?
- How to limit the number of characters allowed in form input text field?
Advertisements