web api instance property
ElementInternals: validationMessage property
The validationMessage read-only property of the ElementInternals interface returns the validation message for the element.
Value
A string containing the validation message of this element.
Examples
In the following example the validation message is set with setValidity(), and then returned with validationMessage.
this.internals_.setValidity({ valueMissing: true }, "my message");
console.log(this.internals_.validationMessage); // "my message"
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.