English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
[ attribute〜= value Selector is used to select elements that contain the specifiedAttributeElements with the specified value.
$("[attribute~=value]")
Select each <img> element that has an alt attribute value (including the word "Parrot"):
$("document").ready(function(){ $("img[alt~=Parrot]").css("border", ""5px solid red"); });Test See‹/›
Parameters | Description |
---|---|
attribute | Specify the attribute name to be selected |
value | Specify the string value to be selected |