Bootstrap JS Tooltip
JS Tooltip
The Tooltip is a small pop-up box that appears when the user moves the mouse pointer over an element.
Via data-* Attributes
The
data-toggle="tooltip"
activates the tooltip.The
title
attribute specifies the text that should be displayed inside the tooltip.Example
<a href="#" data-toggle="tooltip" title="Hooray!">Hover over me</a>
Via JavaScript
Tooltips are not CSS-only plugins, and must therefore be initialized with jQuery: select the specified element and call the
tooltip()
method.Example
// Select all elements with data-toggle="tooltips" in the document$('[data-toggle="tooltip"]').tooltip();
// Select a specified element$('#myTooltip').tooltip();
Credit: www.w3schools.com
Leave a Comment