title: How to change active menu and submenu item style
body: <p>I'm trying to change the colour of active menu/submenu which is selected by user.</p>
  
  <p>For example when <code>Sub11</code> is clicked, <code>Link 1</code> and <code>Sub11</code> will both turn <code>red</code>. Likewise when <code>Sub22</code> is clicked, <code>Link 2</code> and <code>Sub22</code> will be <code>red</code>.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>ul a { cursor: pointer; }
  .active { color:red;}</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;ul&gt;
   &lt;li class="active"&gt;&lt;a&gt;Link 1&lt;/a&gt;
       &lt;ul&gt;
           &lt;li&gt;&lt;a&gt;Sub11&lt;/a&gt;&lt;/li&gt;
           &lt;li&gt;&lt;a&gt;Sub12&lt;/a&gt;&lt;/li&gt;
       &lt;/ul&gt;
   &lt;/li&gt;
   &lt;li&gt;&lt;a&gt;Link 2&lt;/a&gt;
       &lt;ul&gt;
           &lt;li&gt;&lt;a&gt;Sub21&lt;/a&gt;&lt;/li&gt;
           &lt;li&gt;&lt;a&gt;Sub22&lt;/a&gt;&lt;/li&gt;
       &lt;/ul&gt;
   &lt;/li&gt;
   &lt;li&gt;&lt;a&gt;Link 3&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;</code></pre>
  </div>
  </div>
  </p>