HTMLSelectElement.checkValidity()
HTMLSelectElement.checkValidity()
方法會檢查元素是否有任何的檢核、驗證條件,並且檢查是否滿足這些條件。如果元素沒有通過這些檢核,瀏覽器會於該元素上觸發一個可取消的 invalid (en-US)
事件,並回傳 false
。
語法
var result = selectElt.checkValidity();
規範
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'HTMLSelectElement.checkValidity()' in that specification. |
Living Standard | No change since the latest snapshot, HTML5. |
HTML5 The definition of 'HTMLSelectElement.checkValidity()' in that specification. |
Recommendation | Initial definition, snapshot of HTML Living Standard |
瀏覽器相容性
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help! (en-US)
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) |