English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

jQuery [attribute|=value] Attribute Selector

jQuery Selectors

[ attribute |= value Selector selects elements with specified attributes whose values are equal to the given string, or start with the string followed by a hyphen (-)

This selector is usually used to handle language attributes.

Syntax:

$("[attribute|=value]")

Example

Select all elements with a lang attribute starting with "en":

$ (document).ready(function () {
  $("[lang|=en]").css("color", "green");
});
Test and see‹/›

Parameter Value

ParametersDescription
attributeSpecify the attribute name to be selected
valueStrings that start with the specified attribute value should be specified

jQuery Selectors