setCustomValidity

The setCustomValidity() method of the HTMLButtonElement interface sets the custom validity message for the button element.

MDN Reference