![]() |
VOOZH | about |
Bootstrap 5 Tooltips are a JavaScript plugin that allows you to add small, interactive, text-based hints to elements on your web page. They are displayed when the user hovers over, clicks on, or focuses on the element. Tooltips can be used to provide additional information about an element, such as a description, or to display a message when an element is disabled.
In Bootstrap 5, tooltips are created by adding the data-bs-toggle="tooltip" attribute to an HTML element and providing a title attribute with the text to be displayed in the tooltip. The tooltips are initialized using JavaScript, usually within the $(document).ready() function, by calling the $('[data-toggle="tooltip"]').tooltip() method. The Disabled elements can be made with the help of the disabled attribute that removes the focus, hover, or click them to trigger a tooltip (or popover).
Syntax:
<button data-toggle="tooltip"
data-placement="top"
title="Tooltip Text" disabled>
...
</button>
Bootstrap 5 Tooltips Usage Disabled elements Attributes:
Example 1: The below example shows the tooltip on the enabled button on hovering as we have added data-toggle="tooltip".
Output:
Example 2: The below example shows the tooltip on the enabled link on hovering as we have added data-toggle="tooltip".
Output:
Reference: https://getbootstrap.com/docs/5.3/components/tooltips/#disabled-elements