jQuery UI API - :data() Selector
Category
Usage
**Description:** Selects elements that have data stored under the specified key.
jQuery( ":data(key)" )
| Parameters | Description |
|---|---|
| key | The key of the data. |
Expression $( "div:data(foo)") Matches an element that has data stored through .data( "foo", value ) the specified storage. div。
Example
Select elements with data and change their background color.
:data() Selector 实例