jQuery Tutorial Tutorials - jQuery [name$="value"] selector

jQuery [name$="value"] selector

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.

jQuery [name$="value"] selector Syntax

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

jQuery [name$="value"] selector Examples

selector 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

Date:2019-08-17 23:36:21 From:www.Lautturi.com author:Lautturi