ElementInternals: validationMessage プロパティ
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.
validationMessage
は ElementInternals
インターフェイスの読み取り専用プロパティで、この要素の検証メッセージを返します。
値
この要素の検証メッセージを含む文字列です。
例
次の例では、検証メッセージを ElementInternals.setValidity()
で設定し、validationMessage
で返しています。
js
this.internals_.setValidity({ valueMissing: true }, "my message");
console.log(this.internals_.validationMessage); // "my message"
仕様書
Specification |
---|
HTML # dom-elementinternals-validationmessage |
ブラウザーの互換性
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.