JavaScript

A method that validates input and automatically shows error messages if there are issues.

reportValidity() [method]

reportValidity()は、フォームや入力欄に設定されているバリデーション(入力チェック)を実行し、不正な入力があればエラーメッセージを表示するメソッドです。

例えば、required属性で必須項目が空だったり、minmaxの制限を守っていない場合、エラーを出してユーザーに入力を促します。

主なポイントは次の通りです。