Only show tooltip when an element has a title attribute

I want to display the jQuery tooltip ONLY when the dom contains a title. For example: I want to tooltip a button. If the button has a title attribute then display the tooltip. If the button doesn't have a title attribute then don't display the tooltip.

Upvotes: 0

Views: 139

Answers (1)

isherwood
isherwood

Reputation: 61063

Could probably just check for the title attribute in the usual way, no?

$('a[title]').tooltip();

Upvotes: 3

Related Questions