![]() |
VOOZH | about |
Bootstrap 5 Tooltips toggle() method is used to toggle a tooltip's visibility manually. Calling it an odd number of times on a tooltip makes it visible, and calling it an even number of times makes it hidden.
tooltip.toggle()The user receives a direct response from this method before the tooltip is ever displayed or hidden.
In this example, we will create Bootstrap 5 Tooltips and call toggle on the tooltip which is positioned to appear on the top of the button.
Output:
In this example, we will create Bootstrap 5 Tooltips and call toggle 2 times on the tooltip which is positioned to appear on the top of the button. Calling toggle 2 times nullifies the toggle method's effects, so the user would see no difference at all on both tooltips.
Output:
Reference:https://getbootstrap.com/docs/5.0/components/tooltips/#toggle