The jQuery Attribute Ends With Selector [name$="value"]
is used to select elements that have a specific attribute
with a value ending with a given string value
.It is case sensitive.
[name$="value"]
selector Syntax$('[attribute$="value"]')
[name$="value"]
selector Examplesselector | test element | result |
---|---|---|
$('li[title$="script"]' |
<li title="Lautturi Tutorial"></li> |
not matched |
$('li[title$="script"]' |
<li title="script"></li> |
matched |
$('li[title$="script"]' |
<li title="SCRIPT"></li> |
not matched |
$('li[title$="script"]' |
<li title="javascript"></li> |
matched |
$('li[title$="script"]' |
<li title="javascript "></li> |
not matched |
$('li[title$="script"]' |
<li title="LearnJavascriptNow"></li> |
not matched |
Following is a simple example which find all elements with a title attribute that contains the word java
and hightlight them.
Try now