title: How to select the divs with the same class name using the jQuery?
body: <p>I have this code, I am trying to add an additional class &quot;active&quot; to all of the elements with the same class inside the experts-list div.</p>
  <p>I want if someone clicks on the heading Athletes then an additional class &quot;active&quot; should be applied on Athlete One, Athlete Two, Athlete Three, and Athlete Four</p>
  <p>and same with the other elements</p>
  <pre><code>&lt;div class=&quot;expert-group-titles&quot;&gt;
      &lt;h3 class=&quot;athlete&quot;&gt;Athletes&lt;/h3&gt;
      &lt;h3 class=&quot;actor&quot;&gt;Actors&lt;/h3&gt;
      &lt;h3 class=&quot;business-man&quot;&gt;Business Men&lt;/h3&gt;
      &lt;h3 class=&quot;chef&quot;&gt;Chefs&lt;/h3&gt;
      &lt;h3 class=&quot;comedian&quot;&gt;Comedians&lt;/h3&gt;
      and list goes on...
  &lt;/div&gt;
  &lt;div class=&quot;experts-list&quot;&gt;
      &lt;div class=&quot;expert-box athlete&quot;&gt;Athlete One&lt;/div&gt;
      &lt;div class=&quot;expert-box athlete&quot;&gt;Athlete Two&lt;/div&gt;
      &lt;div class=&quot;expert-box athlete&quot;&gt;Athlete Three&lt;/div&gt;
      &lt;div class=&quot;expert-box athlete&quot;&gt;Athlete Four&lt;/div&gt;
      &lt;div class=&quot;expert-box actor&quot;&gt;Actor One&lt;/div&gt;
      &lt;div class=&quot;expert-box actor&quot;&gt;Actor Two&lt;/div&gt;
      &lt;div class=&quot;expert-box actor&quot;&gt;Actor Three&lt;/div&gt;
      &lt;div class=&quot;expert-box actor&quot;&gt;Actor Four&lt;/div&gt;
      &lt;div class=&quot;expert-box business-man&quot;&gt;Business Man One&lt;/div&gt;
      &lt;div class=&quot;expert-box business-man&quot;&gt;Business Man Two&lt;/div&gt;
      &lt;div class=&quot;expert-box business-man&quot;&gt;Business Man Three&lt;/div&gt;
      &lt;div class=&quot;expert-box business-man&quot;&gt;Business Man Four&lt;/div&gt;
      &lt;div class=&quot;expert-box chef&quot;&gt;Chef One&lt;/div&gt;
      &lt;div class=&quot;expert-box chef&quot;&gt;Chef Two&lt;/div&gt;
      &lt;div class=&quot;expert-box chef&quot;&gt;Chef Three&lt;/div&gt;
      &lt;div class=&quot;expert-box chef&quot;&gt;Chef Four&lt;/div&gt;
      &lt;div class=&quot;expert-box comedian&quot;&gt;Comedian One&lt;/div&gt;
      &lt;div class=&quot;expert-box comedian&quot;&gt;Comedian Two&lt;/div&gt;
      &lt;div class=&quot;expert-box comedian&quot;&gt;Comedian Three&lt;/div&gt;
      &lt;div class=&quot;expert-box comedian&quot;&gt;Comedian Four&lt;/div&gt;
      and list goes one...
  &lt;/div&gt;
  </code></pre>