HTMLSelectElement.checkValidity()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since December 2018.
HTMLSelectElement.checkValidity()
方法會檢查元素是否有任何的檢核、驗證條件,並且檢查是否滿足這些條件。如果元素沒有通過這些檢核,瀏覽器會於該元素上觸發一個可取消的 invalid
事件,並回傳 false
。
語法
js
var result = selectElt.checkValidity();
規範
Specification |
---|
HTML Standard # dom-cva-checkvalidity-dev |
瀏覽器相容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
checkValidity |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on 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.