Search code examples
jquerycss-selectorstooltiptitle

jQuery Select All Elements That Have a Title


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.


Solution

  • Simply:

    $('[title]')
    

    See also - Has Attribute Selector:

    Selects elements that have the specified attribute, with any value.