VOOZH about

URL: https://www.geeksforgeeks.org/bootstrap/bootstrap-5-list-group-dispose-method/

⇱ Bootstrap 5 List group dispose() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Bootstrap 5 List group dispose() Method

Last Updated : 15 Mar, 2025

Bootstrap's List group dispose() Method is utilized to dispose of a tab of the list group. This method can work only after the instance is pre-initialized.

The dispose() method is used to dispose of the list group's tab i.e. destroy the instance of the particular list group tab from the DOM.

Syntax:

var a = document.getElementById("list_group-tab-id");
a.dispose();

Parameters: This method accepts arguments from either an HTML element or its selector.

Example 1: This example demonstrates the usage of the dispose() method on a list group and disposal of an individual tab and also getting the instance of the tab to dispose of the tab in the list group. You can see the list group instance before and after disposing of the list group tab.

Output:

Example 2: This example demonstrates the usage of the dispose() method on a list group and dispose an individual tab and also creating and getting the instance of the tab to dispose the tab of the list group.

Output:

Comment
Article Tags:

Explore