DOM Methods

HTMLInputElement.reportValidity()

Checks constraints and requests native reporting of an uncanceled invalid event. Use this when the user should receive validation feedback. Browser message appearance and wording vary. The result does not replace application validation. Example result: false.

Formal Syntax & Structure

html syntaxhtml
element.reportValidity()

Return Value

boolean

Checks constraints and requests native reporting of an uncanceled invalid event.

Working Example

Example Snippethtml
<input id="demo" required><p>  Result:  <output id="result"></output></p><script>  const e = document.getElementById('demo');  const result = value => { document.getElementById("result").textContent = String(value); };  result(e.reportValidity());</script>

Browser Compatibility

Minimum supported versions across modern rendering engines

Widely Available
Chrome
40
Yes
Edge
17
Yes
Firefox
49
Yes
Safari
10.1
Yes
Checked desktop BCD snapshot: HTMLInputElement.reportValidity method; validation UI varies. Versions denote the recorded start of support (≤ means at least that early), not a guarantee of all behavior. Unresolved mirror and preview rows omitted.
HTML Living Standard
HTML Reference