HTMLSelectElement: setCustomValidity() メソッド

Baseline 2023

Newly available

Since March 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

HTMLSelectElement.setCustomValidity() メソッドは、選択要素のカスタム検証メッセージを指定されたメッセージに設定します。要素にカスタム検証エラーがないことを示す場合は、空の文字列を使用してください。

構文

js
setCustomValidity(string)

引数

  • string は、エラーメッセージの入った文字列です。

返値

なし(undefined)。

仕様書

Specification
HTML Standard
# dom-cva-setcustomvalidity-dev

ブラウザーの互換性

BCD tables only load in the browser

関連情報