I wondered if it is possible to set the maxlength to limit the maximum input in terms of the total width of characters, not the number of characters.
I'm doing this because users' input will be displayed in a fixed-width div, say, 3em width div, which will be able to display "MMM" or "1111", if I specify max-length is 4, user may put in "MMMM" which will go outside the div. if I specify max-length with 3, user then can't put in "1111". so I think if I can set maxlength with 3em, then user can put in "1111" while preventing "MMMM". I tried:
<input maxlength="6em" type="text">