ElementInternals: validationMessage-Eigenschaft
Baseline 2023Newly available
Since March 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
Die schreibgeschützte validationMessage
-Eigenschaft der ElementInternals
-Schnittstelle gibt die Validierungsnachricht für das Element zurück.
Wert
Ein String, der die Validierungsnachricht dieses Elements enthält.
Beispiele
Im folgenden Beispiel wird die Validierungsnachricht mit ElementInternals.setValidity()
festgelegt und dann mit validationMessage
zurückgegeben.
js
this.internals_.setValidity({ valueMissing: true }, "my message");
console.log(this.internals_.validationMessage); // "my message"
Spezifikationen
Specification |
---|
HTML # dom-elementinternals-validationmessage |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
validationMessage |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.