In computer science, an enumerated type is a data type consisting of a limited set of named values.
Each enumerated attribute has a default value for when the attribute is present without a value (the value is missing), and a default value for when the attribute is assigned an invalid value. Unlike Boolean HTML attributes — which are always true when the attribute is present whether the value is present, omitted, or invalid — with enumerated HTML attributes, the default for an omitted value may be different from the default for invalid values. For example, the global HTML
contenteditable attribute has two valid keywords:
false. If the attribute is present but no value is set, the value is
true. If a value is set, but is invalid, such as
contenteditable="contenteditable", the value maps to a third state,
ARIA states and properties, being HTML, also have enumerated attributes. If an ARIA attribute includes a both a
false value in the enumerated list, it generally treats an omitted attribute as
false and an invalid value as
true, while the default value for the empty string or omitted value depends on the attribute.
For example, the
aria-current attribute accepts a limited list of values that includes
false. In this case, if the attribute is not present, is an empty string, is present with no value, or is set to
aria-current="false" the attribute is false and is not exposed to the user. Any non-empty string value not in the list of enumerated values is treated as if
aria-current="true" were set.