Add tooltip for item selection in Bootstrap 3

Does anyone know how to add a Bootstrap 3 tooltip to a selection item?

No problems with inputs or text fields.

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

I tried to change the trigger data to something else, for example, β€œhover”, but no luck! The JS event handler we use is as follows:

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

Thanks!

+6
source share
1 answer

Create tooltips like this.

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

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

+9
source

Source: https://habr.com/ru/post/956328/


All Articles