Phenomenon
The maxlength attribute, which works on <input> and <textarea> elements, is not supported on contenteditable regions. There is no built-in way to limit the amount of content that can be entered.
Reproduction example
- Create a contenteditable div with
maxlength="100". - Try to type more than 100 characters.
- Observe whether the input is limited.
Observed behavior
- In Chrome on Windows, the
maxlengthattribute is ignored on contenteditable. - Users can enter unlimited content.
- No built-in validation or limitation exists.
Expected behavior
- The
maxlengthattribute should be supported on contenteditable. - Input should be limited to the specified length.
- Or, there should be a standard way to limit content length.