title: Active class not changing to items for navbar in bootstrap
body: <p>I have this navbar from bootstrap which is supposed to add active class on nav-item or on anchor element on click, but while inspecting it in browser its not changing states, I don't understand why.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.nav-link {
    color: #FFF;
    width: 100%;
    height: 100%;
    text-transform: uppercase;
  }
  
  .nav-link::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: green;
    transition: width .3s;
  }
  
  .nav-link:hover::after {
    width: 100%;
  }
  
  .navbar-nav&gt;.active&gt;a {
    color: #00cc00;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;nav class="navbar navbar-expand-lg navbar-dark " style="background-color: black;"&gt;
    &lt;div class="container-fluid"&gt;
      &lt;a class="navbar-brand d-lg-none" href="#"&gt;&lt;img src="../assets/images/howdy-white.png" style="width:45px; height:45px;" /&gt;&lt;/a&gt;
      &lt;button class="navbar-toggler shadow-none" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation"&gt;
          &lt;span class="navbar-toggler-icon"&gt;&lt;/span&gt;
        &lt;/button&gt;
      &lt;a class="navbar-brand d-none d-lg-block" href="#"&gt;&lt;img src="../assets/images/howdy-white.png" style="width:45px; height:45px;" /&gt;&lt;/a&gt;
      &lt;div class="collapse navbar-collapse justify-content-end" id="navbarNavAltMarkup"&gt;
        &lt;ul class="navbar-nav"&gt;
          &lt;li class="nav-item active"&gt;
            &lt;a class="nav-link" href="#"&gt;Home&lt;/a&gt;
          &lt;/li&gt;
          &lt;li class="nav-item"&gt;
            &lt;a class="nav-link" href="#"&gt;about&lt;/a&gt;
          &lt;/li&gt;
          &lt;li class="nav-item"&gt;
            &lt;a class="nav-link" href="#"&gt;works&lt;/a&gt;
          &lt;/li&gt;
          &lt;li class="nav-item"&gt;
            &lt;a class="nav-link" href="#"&gt;contacts&lt;/a&gt;
          &lt;/li&gt;
          &lt;li class="nav-item"&gt;
            &lt;a class="nav-link" href="#"&gt;services&lt;/a&gt;
          &lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/nav&gt;</code></pre>
  </div>
  </div>
  </p>