set max length of text field html code example
Example 1: input max length
<input maxlength="10" />
Example 2: html input max vs maxlength
<input type="text" maxlength="4"/>
<input maxlength="10" />
<input type="text" maxlength="4"/>