jQuery [attribute*=value]Selector

jQuery 选择器jQuery Selectors

Examples

Select all <input> elements with a name attribute containing the string "nation":

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

Try it Yourself »

Definition and Usage

The [attribute*=value] selector selects each element with the specified attribute whose value contains the specified string.


Syntax

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

Parameters Description
attribute Required. Specifies the attribute to look for.
value Required. Specifies the string that the value must contain.


jQuery 选择器jQuery Selectors

Other Extensions