Runtime Error
CustomValidityInvalidElement
The data-custom-validity
attribute was used on an element that is not a HTMLInputElement
, HTMLSelectElement
or HTMLTextAreaElement
. The data-custom-validity
attribute can only be used on input, select and textarea elements.
The data-custom-validity
attribute must only have a value, representing an expression that must evaluate to a string that will be set as the custom validity message. If the string is empty, the input is considered valid. If the string is non-empty, the input is considered invalid and the string is used as the reported message.
Example:
See the docs for the data-custom-validity
attribute.