Back to Content

HTMLObjectElement: checkValidity() method

files/en-us/web/api/htmlobjectelement/checkvalidity/index.md

latest997 B
Original Source

{{APIRef("HTML DOM")}}

The checkValidity() method of the {{domxref("HTMLObjectElement")}} interface checks if the element is valid, but always returns true because {{HTMLElement("object")}} elements are never candidates for constraint validation.

Syntax

js-nolint
checkValidity()

Parameters

None.

Return value

A boolean value, true.

Examples

In the following example, calling checkValidity() returns true.

js
const element = document.getElementById("myObjectElement");
console.log(element.checkValidity());

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also