Phate
Phate

Reputation: 6612

Jquery ui tooltip doesn't displayon button tag

I have this simple button tag:

<button class="toolb">this is a button</button>

This is my code:

$(".toolb").tooltip({ content: "example tooltip!" });

I hover the mouse on the button, but no tooltip is displayed. How come?

Upvotes: 0

Views: 37

Answers (2)

morissette
morissette

Reputation: 1099

Try:

<button class="toolb" title="example tooltip!">this is a button</button>
<script>
$(document).tooltip();
</script>

Upvotes: 1

j08691
j08691

Reputation: 207901

Your button needs a title attribute to work, even if it's empty:

<button class="toolb" title="">this is a button</button>

jsFiddle example

Upvotes: 1

Related Questions