1. 給開發者的 Web 技術文件
  2. Web API
  3. HTMLSelectElement
  4. HTMLSelectElement.setCustomValidity()

此頁面由社群從英文翻譯而來。了解更多並加入 MDN Web Docs 社群。

View in English Always switch to English

HTMLSelectElement.setCustomValidity()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨2015年7月⁩.

HTMLSelectElement.setCustomValidity() 方法可為指定的元素設定自定義檢核訊息。使用空字串表示元素沒有發生違反自定檢核條件的錯誤。

語法

js
selectElt.setCustomValidity(string);

參數

規範

Specification
HTML
# dom-cva-setcustomvalidity-dev

瀏覽器相容性

參見

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.

AltStyle によって変換されたページ (->オリジナル) /