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.
:header Selector Selects all elements that are headers, like h1, h2, h3 and so on.
In jQuery, you can select multiple elements by separate it with a comma “,” symbol.
Simply:
$('[title]')
See also - Has Attribute Selector:
Selects elements that have the specified attribute, with any value.
Also $('[title][title!=]')
should work but catches only elements that have title set and not empty (not title=""
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With