TOP
EL EN
Selectors - Attribute selector
15 September 2024 Published by Aristotelis Pitaridis
Tools used for this tutorial
jQuery 3.7.1
SHARE

The following example demonstrates how to select all the <a> elements which have a title attribute.

var elements = $('a[title]');

We can also filter these elements by asking jQuery to give us only the elements which have a specific value. The following example finds all the <a> elements that have a title attribute equal to "Programming Languages".

var elements = $('a[title="Programming Languages"]');