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.