6

Anyone know how to add a Bootstrap 3 tooltip to a select element?

Having no problems with inputs or textareas.

<select data-toggle='tooltip' data-trigger='focus' data-placement='top' title='The number of tags to create.'>

Tried changing data-trigger to something else like 'hover' but no luck! The JS event handler we're using is as follows:

$("[data-toggle='tooltip']").each(function (index, el) {
    $(el).tooltip({
        placement: $(this).data("placement") || 'top'
    });
});

Thank you!

Anthony Vipond
  • 1,879
  • 2
  • 19
  • 21

1 Answers1

9

Create the tooltips like this..

$("[data-toggle='tooltip']").tooltip({
    placement: $(this).data("placement") || 'top'
});

Working Demo: http://bootply.com/89593

Carol Skelly
  • 351,302
  • 90
  • 710
  • 624