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

jQuery [attribute$=value] Attribute Selector

jQuery Selectors

[ attribute $ = value The selector is used to select elements with attribute values specified byvalueelements ending with the specified string.

Syntax:

$("[attribute$=value]")

Example

Select each <a> element with href attribute value ending with " .org":

$("document").ready(function(){
  $("a[href$='.org'].css({"background":"green", "color":"white"});
});
Test and see‹/›

Parameter Value

ParameterDescription
attributeSpecify the attribute name to be selected
valueThe specified value should end with the string

jQuery Selectors