setCustomValidity

The setCustomValidity() method of the HTMLOutputElement interface sets the custom validity message for the output element.

MDN Reference