setCustomValidity

The HTMLInputElement.setCustomValidity() method sets a custom validity message for the element.

MDN Reference