Back to Content

HTMLSelectElement: reportValidity() method

files/en-us/web/api/htmlselectelement/reportvalidity/index.md

latest1009 B
Original Source

{{APIRef("HTML DOM")}}

The reportValidity() method of the {{domxref("HTMLSelectElement")}} interface performs the same validity checking steps as the {{domxref("HTMLSelectElement.checkValidity", "checkValidity()")}} method. In addition, if the {{domxref("HTMLElement/invalid_event", "invalid")}} event is not canceled, the browser displays the problem to the user.

Syntax

js-nolint
reportValidity()

Parameters

None.

Return value

Returns true if the element's value has no validity problems; otherwise, returns false.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also