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.
selectElt.setCustomValidity(string);
DOMString containing the error message.| Specification | Status | Comment |
|---|---|---|
| HTML Living Standard The definition of 'HTMLSelectElement.setCustomValidity()' in that specification. | Living Standard | No change since the latest snapshot, HTML5. |
| HTML5 The definition of 'HTMLSelectElement.setCustomValidity()' in that specification. | Recommendation | Initial definition, snapshot of HTML Living Standard |
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
| Basic support | Yes | Yes | 4 | Yes | ? | ? |
| Mobile | |||||||
|---|---|---|---|---|---|---|---|
| Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
| Basic support | ? | ? | Yes | 4 | ? | ? | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement/setCustomValidity