In Bootstrap 5, the data-*
attribute used in Bootstrap 4 has been replaced with data-bs-*
<button class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#navbar"> <span class="navbar-toggler-icon"></span> </button>
As explained in the documentation , all JavaScript plugin data attributes are now namespaced to help differentiate Bootstrap functionality from third-party and your own code. This means that any javascript component (collapse, navbar, carousel, dropdown, tab, modal, etc.) can only use the data-bs-...
attribute.
Bootstrap 5 is a major update with breaking changes. Additionally, View here, ml-auto
/mr-auto
has been changed to ms-auto
/me-auto
.