Parents jquery in menu multiple levels
<p>Sorry because my English not good! But I have a problem like this.</p>

<ol>
<li><p>This is my html code (It's a menu multiple level, and levels menu is dynamic)</p>

<pre><code>&lt;!-- menu level 1--&gt;
 &lt;ul class='ul_parent'&gt;
   &lt;li&gt;
      &lt;a href='#' class='fNiv'&gt;home&lt;/a&gt;
   &lt;/li&gt;
   &lt;li&gt;
      &lt;a href='#' class='fNiv'&gt;News&lt;/a&gt;
   &lt;/li&gt;
   &lt;li&gt;
      &lt;a href='#' class='fNiv'&gt;Product&lt;/a&gt;
      &lt;!-- menu level 2--&gt;
      &lt;ul class='ul_childrent'&gt;
        &lt;li&gt;
            &lt;a href='#'&gt;Type 1&lt;/a&gt;
            &lt;!-- menu level 3--&gt;
            &lt;ul class='ul_childrent'&gt;
                 &lt;li&gt;
                     &lt;a href='#'&gt;Type 1.1&lt;/a&gt;
                     &lt;!--........--&gt;
                     &lt;!-- menu level n--&gt;
                     &lt;!-- ........--&gt;     
                     &lt;ul class='ul_childrent'&gt;
                         &lt;li&gt;&lt;a href='#' class='menu_level_n'&gt;Type 1.1...n&lt;/a&gt;&lt;/li&gt;
                     &lt;/ul&gt;
                 &lt;/li&gt;
                 &lt;li&gt;&lt;a href='#'&gt;Type 1.2&lt;/a&gt;&lt;/li&gt;
                 &lt;li&gt;&lt;a href='#'&gt;Type 1.3&lt;/a&gt;&lt;/li&gt; 
            &lt;/ul&gt;
       &lt;/li&gt;
        &lt;li&gt;&lt;a href='#'&gt;Type 2&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href='#'&gt;Type 3&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt; 
   &lt;/li&gt;
 &lt;/ul&gt;
</code></pre></li>
<li><p>I want when click in '<code>.menu_level_n</code>' go to set menu level 1 is active (menu class <code>.fNiv</code>). This may code jquery (it not work).      </p>

<pre><code>$(document).ready(function(){
             $('.menu_level_n').click(function(){
                 $(this).parents('.fNiv').addClass('active');
             });
       });
</code></pre></li>
</ol>

<p>Please help me! Thanks so murch.</p>
