jQuery [attribute^=value] Selector (original) (raw)

Last Updated : 11 Jul, 2025

The **jQuery **[attribute^=value] selector is used to select all elements with a given attribute specified by an attribute parameter that starts with the word specified by value parameter.

**Syntax:

$("[attribute^='value']")

**Parameters: This selector contains two parameters which are listed below:

**Example 1: This example uses [attribute^=value] selector to select those elements whose class name starts with top.

HTML `

jQuery [attribute^=value] Selector

Welcome to GeeksforGeeks

A Computer Science portal for geeks.
It contains well written, well thought and well explained
computer science and programming articles

Competitive programming is not tough.

Every one should learn Programming.

`

**Output:

**Example 2: This example uses [attribute^=value] selector to select those elements whose class name starts with top.

HTML `

jQuery [attribute^=value] Selector
One
Two
Three
Four
Five

`

**Output: