Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add tooltip to select element in Bootstrap 3

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!

like image 581
Anthony Vipond Avatar asked Oct 19 '13 19:10

Anthony Vipond


1 Answers

Create the tooltips like this..

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

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

like image 74
Zim Avatar answered Sep 19 '22 13:09

Zim