VOOZH about

URL: https://www.geeksforgeeks.org/bootstrap/bootstrap-5-tooltips-toggleenabled-method/

⇱ Bootstrap 5 Tooltips toggleEnabled() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Bootstrap 5 Tooltips toggleEnabled() Method

Last Updated : 22 Jul, 2024

A tooltip is a UI element that is used to show some extra information when the user hovers over or focuses on a tooltip-enabled element. 

The toggleEnabled() method of the tooltip toggles the enabled/disabled state of the tooltip. When in the "disabled" state, the tooltip cannot be shown or hidden.

Syntax:

const tooltip = new bootstrap.Tooltip(
document.getElementById('tooltip-id'));
tooltip.toggleEnabled();

Parameters: This method does not accept any parameter.

Return Value: This method does not return any value to the caller.

Example 1: In this example, we used the toggleEnabled() method of the tooltip to enable/disable the tooltip.

Output:

Example 2: In this example, we used the toggleEnabled() method of the tooltip along with its enable() and disable() methods.

Output:

Reference:https://getbootstrap.com/docs/5.0/components/tooltips/#toggleenabled

Comment

Explore