MDN wants to learn about developers like you: https://qsurvey.mozilla.com/s3/MDN-dev-survey

HTMLSelectElement.checkValidity()

翻译正在进行中。

HTMLSelectElement.checkValidity() 会检查元素是否有任何输入约束条件,并且检查值是否符合约束条件. 如果值是不符合约束条件的, 浏览器就会在该元素上触发一个可以撤销的 invalid 事件,  然后返回 false.

Syntax

var result = selectElt.checkValidity();

Specifications

Specification Status Comment
HTML Living Standard
HTMLSelectElement.checkValidity()
Living Standard No change since the latest snapshot, HTML5.
HTML5
HTMLSelectElement.checkValidity()
Recommendation Initial definition, snapshot of HTML Living Standard

Browser compatibility

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support (Yes) (Yes) 4.0 (2.0) 10 (Yes) (Yes)
Feature Android Chrome Edge Firefox Mobile (Gecko) Firefox OS IE Phone Opera Mobile Safari Mobile
Basic support ? (Yes) (Yes) 4.0 (2.0) 1.0 ? ? (Yes)

See also

文档标签和贡献者

 此页面的贡献者: DominicMing
 最后编辑者: DominicMing,