The jQuery Attribute Equals Selector [name="value"]
is used to select elements that have a specific attribute
with a value exactly equal to the given string value
.It is case sensitive.
[name="value"]
selector Syntax$('[attribute="value"]')
[name="value"]
selector Examplesexample:
$("input[name='newsletter']") //Find all [INPUT] elements that [name] attribute is [newsletter]
Following is a simple example which makes use of Attribute Equals Selector.
This would select the all elements exactly with a title of script
and hightlight them.
It is case sensitive. So only one element is selected.
Try now