title: Active applying to only one element
body: <p>I am using jQuery to add active to my menu. It works on the index page, but I can't get it to work on the other pages right now. I've tried changing around the web address to fit the exact location.pathname but that doesn't seem to work, and I tried dropping the \ prior to it as well. Any help would be appreciated. </p>
  
  <p>my markup:</p>
  
  <pre><code>&lt;nav class="sticky-top navbar navbar-expand-lg navbar-light bg-myColor"&gt;
      &lt;a class="navbar-brand" href="#"&gt;
        &lt;img src="image/VC-Logo.png" alt="Visionary Creatives logo" height="150px;" /&gt;
      &lt;/a&gt;
      &lt;button class="navbar-toggler navbar-brand" type="button" data-toggle="collapse" data-target="#navToggle" aria-controls="navToggle" aria-expanded="false" aria-label="Toggle navigation"&gt;
        &lt;span class="navbar-toggler-icon"&gt;&lt;/span&gt;
      &lt;/button&gt;
      &lt;div class="collapse navbar-collapse" id="navToggle"&gt;
      &lt;ul class="navbar-nav mr-auto mt-2 mt-lg-0"&gt;
      &lt;/ul&gt;
      &lt;ul class="navbar-nav"&gt;
        &lt;li class="nav-item"&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="/coming-soon.php"&gt;Web Design&lt;/a&gt;
        &lt;/li&gt;
        &lt;li class="nav-item"&gt;
          &lt;a class="nav-link" href="/coming-soon.php"&gt;Graphic Design&lt;/a&gt;
        &lt;/li&gt;
        &lt;li class="nav-item"&gt;
          &lt;a class="nav-link" href="/coming-soon.php"&gt;SEO &amp;amp; Marketing&lt;/a&gt;
        &lt;/li&gt;
        &lt;li class="nav-item"&gt;
          &lt;a class="nav-link" href="/coming-soon.php"&gt;About Us&lt;/a&gt;
        &lt;/li&gt;
        &lt;li class="nav-item"&gt;
          &lt;a class="nav-link" href="/coming-soon.php"&gt;Contact Us&lt;/a&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
  &lt;/nav&gt;
  </code></pre>
  
  <p>and my jQuery:</p>
  
  <pre><code>$(document).ready(function() {
    $('.navbar-nav .nav-item a[href="' + this.location.pathname + 
  '"]').parent().addClass('active');
  });
  </code></pre>
  
  <p>and my website if this helps as well:
  <a href="http://www.visionary-creatives.com" rel="nofollow noreferrer">http://www.visionary-creatives.com</a></p>