I'm having a difficult time trying to create a collapsible navigation bar and changing the value of 'aria-expanded'.
Even after setting it to "true", it doesn't switch back to "false" on the second click.
I've tried multiple times, reviewed the documentation, but still no luck.
Feeling frustrated, I resorted to copying the code directly from the docs. Surprisingly, it yielded the same non-functional result.
I just can't figure out what's wrong :/
Here is the code snippet from the documentation:
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button& data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Pricing</a>
</li>
<li class="nav-item">
<a class="nav-link disabled">Disabled</a>
</li>
</ul>
</div>
</div>
</nav>