![]() |
VOOZH | about |
In this article, we will learn about the Bootstrap 5 List Group events fired when interacting with the Bootstrap 5 List Group.
For example, these events are fired when a tab is clicked and made active and the previous tab is made inactive.
Bootstrap 5 List Group component is useful for displaying a series of content, either vertically or horizontally. They can be used for different menu items or a list of content on the webpage.
When a new tab is clicked and made active, the above events fire in the following order:
listGroupEl.addEventListener(list_group_event, callbackFunction);Let us understand more about this using some examples below:
Example 1: In this example, we will listen for the list group events that get fired when a list group gets active or visible. We only look for show.bs.tab event here.
Output:
Example 2: In this example, we will listen for the list group events that get fired when a list group gets hidden. We only look for hidden.bs.tab events here.
Output:
Reference: https://getbootstrap.com/docs/5.0/components/list-group/#events