A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://developer.mozilla.org/ja/docs/Web/API/HTMLButtonElement/setCustomValidity below:

HTMLButtonElement: setCustomValidity() メソッド - Web API

HTMLButtonElement: setCustomValidity() メソッド

Baseline Widely available

setCustomValidity() は HTMLButtonElement インターフェイスのメソッドで、 独自の検証メッセージを <button> 要素に設定します。空文字列を使用すると、要素に独自の検証エラーがないことを示します。

構文
setCustomValidity(string)
引数
string

エラーメッセージが入った文字列。空文字列を指定すると、独自の検証エラーがすべて除去されます。

返値

なし (undefined)。

例
const errorButton = document.getElementById("checkErrors");
const errors = issuesToReport();
if (errors) {
  errorButton.setCustomValidity("エラーがあります");
} else {
  errorButton.setCustomValidity("");
}
仕様書 ブラウザーの互換性 関連情報

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4