jQuery [attribute|=value] Selector (original) (raw)
Last Updated : 11 Jul, 2025
The jQuery **[attribute|=value] selector is used to select each element with a specific attribute, with a specific string value (like "geeks") or starting string followed by a hyphen (like "geeks-forgeeks").
**Syntax:
$("[attribute|='value']")
**Parameter:
- **attribute : This parameter is required to specify the attribute to be searched.
- **value : This parameter is required to specify the string the attribute value should start with.
**Example 1:
HTML `
Geeks For Geeks
Geeks1
Geeks2
Geeks3
Geeks4
Geeks5
`
**Output:

**Example 2:
HTML `
Geeks For Geeks
Geeks1
Geeks2
Geeks3
Geeks4
Geeks5
Change color`
**Output:
