HTMLSelectElement: setCustomValidity() method
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{ APIRef("HTML DOM") }}
The **HTMLSelectElement.setCustomValidity()** method sets the custom validity message for the selection element to the specified message. Use the empty string to indicate that the element does _not_ have a custom validity error.
Syntax
js-nolint
setCustomValidity(string)Parameters
string- : The string containing the error message. The empty string removes any custom validity errors.
Return value
None ({{jsxref("undefined")}}).
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}