jQuery [attribute^=value]Selector

jQuery 选择器jQuery Selector

Examples

Select all <input> elements with a name attribute that starts with "nation":

$("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']")

Parameter Description
attribute Required. Specifies the attribute to find.
value Required. Specifies the string that the attribute value starts with.


jQuery 选择器jQuery Selector

Other Extensions