![]() |
VOOZH | about |
Bootstrap 5 Popover is an attribute in bootstrap that can be used to make any website look more dynamic. Popovers are generally used to display additional information about any element and are displayed with a click of a mouse pointer over that element.
The dispose() method is used to remove and destroy the popover element from the DOM itself. After using this method, the user will not be able to see the popover at all.
myPopover.dispose()This method removes stored data on the DOM element.
Let us understand more about this using some examples below:
Example 1: In this example, we will toggle the popover element's visibility and then destroy the element using the dispose() method given by the Bootstrap 5 Popover object.
Output:
Example 2: In this example, we will show and hide the popover element's visibility and then destroy the element using the "show", "hide" and "dispose" methods given by the Bootstrap 5 Popover object.
Output:
Reference: https://getbootstrap.com/docs/5.0/components/popovers/#dispose