Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery [attribute^=value] Selector

jQuery [attribute^=value] Selector

jQuery selector jQuery selector

Example

Select all elements with a name attribute that starts with "nation" element:

$("input[name^='nation']")

Try it »


Definition and Usage

The [attribute^=value] selector selects every element with the specified attribute whose value starts with the specified string.


Syntax

$("[

attribute^

=

'value'

]")

Parameters Description
attribute Required. Specifies the attribute to look for.
value Required. Specifies the string with which the attribute value must start.

jQuery selector jQuery selector