--- title: HTMLSelectElement.setCustomValidity() slug: Web/API/HTMLSelectElement/setCustomValidity translation_of: Web/API/HTMLSelectElement/setCustomValidity ---
El metodo HTMLSelectElement.setCustomValidity()
define el mensaje de validación personalizado para el elemento seleccionado con el mensaje especifico. Usa una string vacia para indicar que ese elemento no tiene error de validación customizado.
selectElt.setCustomValidity(string);
string
is the {{domxref("DOMString")}} containing the error message.Specification | Status | Comment |
---|---|---|
{{SpecName('HTML WHATWG', '#dom-cva-setcustomvalidity', 'HTMLSelectElement.setCustomValidity()')}} | {{Spec2('HTML WHATWG')}} | No change since the latest snapshot, {{SpecName('HTML5 W3C')}}. |
{{SpecName('HTML5 W3C', 'forms.html#dom-cva-setcustomvalidity', 'HTMLSelectElement.setCustomValidity()')}} | {{Spec2('HTML5 W3C')}} | Initial definition, snapshot of {{SpecName('HTML WHATWG')}} |
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
{{Compat("api.HTMLSelectElement.setCustomValidity")}}