![]() |
VOOZH | about |
Bootstrap 5 Tooltip is a UI element that shows some extra information when the user hovers over or focuses on a tooltip-enabled element. The Tooltip show() method is used to show an element's tooltip. The Tooltip having the zero title length will not be visible.
Syntax:
const tooltip = new bootstrap.Tooltip(document.getElementById('tooltip-id'));
tooltip.show();
Parameters: This method does not accept any parameter.
Return Value: This method returns to the caller before the tooltip has been revealed to the front end.
Example 1: In this example, we used the show() method to reveal the tooltip of an element.
Output:
Example 2: In this example, we used the tooltip's show() method along with the hide() method to show/hide the tooltip.
Output:
Reference:https://getbootstrap.com/docs/5.0/components/tooltips/#show