How to set character limit in HTML?

Spread the love

To set 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 set the max number of characters allowed in the input to 10.

Leave a Reply

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