tl; dr: If you pass an invalid value for an enumerated attribute, an invalid default value will be used instead. If this does not exist, it will use the default value instead.
The input type attribute does not specify an invalid default value, but defines a default value that is text .
Therefore, using an invalid default value will be text .
From the WHATWG HTML specification:
Some attributes are defined as taking one of a finite set of keywords. Such attributes are called enumerated attributes. [...] In addition, you can specify two default states. The first is an invalid default ; the second is missing by default .
[...]
If the attribute value does not match any of the specified keywords, but the attribute has an invalid default value, the attribute represents this state. Otherwise, if the attribute value does not match any of the keywords, but there is a specific default value defined by default, then this is the state represented by the attribute. Otherwise, there is no default value, and invalid values ββmean that there is no state presented.
<input> indicates the missing default value, which is text :
Invalid default value is text state.
source share