HTMLSelectElement.setCustomValidity()

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

selectElt.setCustomValidity(string);

Parameters

  • string is the DOMString containing the error message.

Specifications

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

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
setCustomValidityChrome Full support YesEdge Full support 12Firefox Full support 4IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes

Legend

Full support
Full support

See also