此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

CustomStateSet:has() 方法

Baseline 2024
Newly available

Since ⁨May 2024⁩, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

CustomStateSet 接口的 has() 方法返回表示给定值的元素是否存在于对象中的 Boolean

语法

js
has(value)

参数

value

要在 CustomStateSet 对象中测试的值。

返回值

Boolean。当 value 存在于 CustomStateSet 中为 true

规范

Specification
HTML
# custom-state-pseudo-class

浏览器兼容性