setCustomValidity

The setCustomValidity() method of the HTMLObjectElement interface sets a custom validity message for the element.

MDN Reference