jQuery [attribute] Selector

Example

Selects all elements with the id attribute:

$("[id]")

Try It Yourself

Definition and Usage

[attribute] Selects each element with the specified attribute.

Can select elements with any attribute (no restrictions on the specified attribute).

Syntax

$("[attribute]")
Parameters Description
attribute Required. Specifies the attribute to be searched for.