Notice: This is a work in progress. Please submit feedback or suggestions.

maxlength attribute (html)

Screen reader support level: partial (1/10)

Voice Control support level: not applicable

On this page

About this feature

The min and max attributes indicate the allowed range of values for the element.

Age of results

Results across all tests for this feature range from 6 months ago to 6 months ago. Detailed dates and version information can be found in associated tests.

Failing and partial results are between 6 months ago and 6 months ago.

Expectations

What are expectations?

Screen Reader support by expectation

ExpectationJAWSNarratorNVDAOrcaTalkBackVoiceOver (iOS)VoiceOver (macOS)
ChromeIEFirefoxEdgeChromeFirefoxFirefoxChromeSafariSafari
MUST convey when the maximum length is reachednonenonenonenonenonenonenonenonenonesupported
MAY convey the maximum length when navigating to an inputnonenonenonenonenonenonenonenonenonenone

Voice Control support by expectation

ExpectationDragon Naturally SpeakingVoice Access (Android)Voice Control (iOS)Voice Control (MacOS)Windows Speech Recognition
ChromeChromeSafariSafariChrome
Not applicable

Expectation: convey when the maximum length is reached

Rationale:

The attribute prevents characters beyond the maximum length from being entered. The user needs to know when the maximum length has been reached, so that they do not think that they are entering data when they are in fact not.

Strength of this expectation for different types of assistive technologies:

  • Screen Readers: MUST
  • Voice Control: NA

Examples:

  • screen readers might announce an earcon when the user tries to enter data beyond the maximum length.
  • screen readers might imply that the maximum length has been reached by not announcing anything when a user tries to enter data (usually the keypress is echoed)
Screen Reader support for 'MUST convey when the maximum length is reached'
TestJAWSNarratorNVDAOrcaTalkBackVoiceOver (iOS)VoiceOver (macOS)
ChromeIEFirefoxEdgeChromeFirefoxFirefoxChromeSafariSafari
HTML maxlength attribute test applied to: input[type="text"] elementnonenonenonenonenonenonenonenonenonesupported

Expectation: convey the maximum length when navigating to an input

Rationale:

The user may wish to know the maximum length when navigating to an input, and before they enter any data.

Strength of this expectation for different types of assistive technologies:

  • Screen Readers: MAY
  • Voice Control: NA

Examples:

  • screen readers might announce the maximum length when navigating to an input.
Screen Reader support for 'MAY convey the maximum length when navigating to an input'
TestJAWSNarratorNVDAOrcaTalkBackVoiceOver (iOS)VoiceOver (macOS)
ChromeIEFirefoxEdgeChromeFirefoxFirefoxChromeSafariSafari
HTML maxlength attribute test applied to: input[type="text"] elementnonenonenonenonenonenonenonenonenonenone