title: Add class to parent menu when sub menu clicked
body: <p>I want to add class to the parent menu when I clicked on the submenu.</p>
  
  <p>When I click on submenu then class <code>active</code> should be added to its parent, I tried but not able to achieve this, Here is my code, pls let me know what I missed in this.</p>
  
  <p><strong><a href="https://jsfiddle.net/6y27da13/2/" rel="nofollow noreferrer">Check this fiddle</a></strong></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-js lang-js prettyprint-override"><code>$(document).ready(function() {
    $(".nav-sub-link").on("click", function(e) {
      debugger;
      e.preventDefault();
      $('.sidebar-nav-link').addClass("active");
    });
  });</code></pre>
  </div>
  </div>
  </p>