title: Jquery if element has class, add class to this element child
body: <p>I want to add a class(active) to a child of an element who has a class (is-active) and does not effect other elements. using jQuery!</p>
  
  <pre><code>&lt;ul&gt;
     &lt;li class="nav-item is-active"&gt;&lt;a href="#" class="nav-link"&gt;Link 1&lt;/a&gt;&lt;li&gt;
     &lt;li class="nav-item"&gt;&lt;a href="#" class="nav-link"&gt;Link 2&lt;/a&gt;&lt;li&gt;
     &lt;li class="nav-item"&gt;&lt;a href="#" class="nav-link"&gt;Link 3&lt;/a&gt;&lt;li&gt;
     &lt;li class="nav-item"&gt;&lt;a href="#" class="nav-link"&gt;Link 4&lt;/a&gt;&lt;li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>I'm using this code but it's effect all other elements.</p>
  
  <pre><code>if ($(".nav-item").hasClass("is-active")) {
    $('a', this).addClass('active');
  }
  </code></pre>
  
  <p>I want to be like this:</p>
  
  <pre><code>&lt;ul&gt;
         &lt;li class="nav-item is-active"&gt;&lt;a href="#" class="nav-link active"&gt;Link 1&lt;/a&gt;&lt;li&gt;
         &lt;li class="nav-item"&gt;&lt;a href="#" class="nav-link"&gt;Link 2&lt;/a&gt;&lt;li&gt;
         &lt;li class="nav-item"&gt;&lt;a href="#" class="nav-link"&gt;Link 3&lt;/a&gt;&lt;li&gt;
         &lt;li class="nav-item"&gt;&lt;a href="#" class="nav-link"&gt;Link 4&lt;/a&gt;&lt;li&gt;
  &lt;/ul&gt;
  </code></pre>