jQuery Select All Elements That Have a Title

Jimbo picture Jimbo · Jun 14, 2010 · Viewed 12.2k times · Source

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.

Answer

Kobi picture Kobi · Jun 14, 2010

Simply:

$('[title]')

See also - Has Attribute Selector:

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