How to set the character limit in HTML?

Spread the love

To set the character limit in HTML, we set the maxlength attribute.

For instance, we write

<input type="text" id="Textbox" name="Textbox" maxlength="10" />

to set the maxlength attribute to 10 to make the input takes max 10 characters.

Leave a Reply

Your email address will not be published. Required fields are marked *