Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. ElementInternals
  4. validationMessage

ElementInternals: validationMessage property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨March 2023⁩.

ThevalidationMessage read-only property of theElementInternals 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 withElementInternals.setValidity(), and then returned withvalidationMessage.

js
this.internals_.setValidity({ valueMissing: true }, "my message");console.log(this.internals_.validationMessage); // "my message"

Specifications

Specification
HTML
# dom-elementinternals-validationmessage

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp