I need to apply a tooltip plugin to a bunch of different elements on my page. The only common property to work with a jQuery selector is that they all have a title property set.
I tried $('[title=*]') as a selector but this didnt work.
I need to apply a tooltip plugin to a bunch of different elements on my page. The only common property to work with a jQuery selector is that they all have a title property set.
I tried $('[title=*]') as a selector but this didnt work.
Simply:
$('[title]')
See also - Has Attribute Selector:
Selects elements that have the specified attribute, with any value.
Try $('*[title]'), more about attribute selectors here on the W3C page.
Also $('[title!=]') should work but catches only elements that have title set and not empty (not title="")